gcc/testsuite/g++.dg/cpp2a/fn-template21.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 | template<typename> |
| 9 | void get (S); |
| 10 | } |
| 11 | |
| 12 | template<typename T> |
| 13 | void bar (const T& t) |
| 14 | { |
| 15 | get<int>(t); |
| 16 | } |
| 17 | |
| 18 | int |
| 19 | main () |
| 20 | { |
| 21 | auto a = M::foo (); |
| 22 | get<int>(a); |
| 23 | bar (a); |
| 24 | } |