gcc/testsuite/g++.dg/cpp2a/nontype-class13.C
raw| 1 | // PR c++/77304 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | struct S {}; |
| 5 | |
| 6 | template < typename T > struct A |
| 7 | { |
| 8 | template < S > void f () {} |
| 9 | |
| 10 | static void * g () |
| 11 | { |
| 12 | return (void *) f < a >; // { dg-error "invalid" } |
| 13 | } |
| 14 | |
| 15 | static S a; |
| 16 | }; |
| 17 | |
| 18 | void * f () |
| 19 | { |
| 20 | return A < int >::g (); |
| 21 | } |