gcc/testsuite/g++.dg/cpp2a/fn-template22.C
raw| 1 | // PR c++/97010 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | namespace M { |
| 5 | struct S { int x; }; |
| 6 | S foo (); |
| 7 | |
| 8 | // Test not-found-by-ADL scenario. |
| 9 | // template<typename> |
| 10 | // void get (S); |
| 11 | } |
| 12 | |
| 13 | template<typename T> |
| 14 | void bar (const T& t) |
| 15 | { |
| 16 | get<int>(t); // { dg-error ".get. was not declared in this scope" } |
| 17 | } |
| 18 | |
| 19 | int |
| 20 | main () |
| 21 | { |
| 22 | auto a = M::foo (); |
| 23 | get<int>(a); // { dg-error ".get. was not declared in this scope" } |
| 24 | bar (a); |
| 25 | } |