gcc/testsuite/g++.dg/cpp1z/nontype-auto21.C
raw| 1 | // PR c++/105964 |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | |
| 4 | struct token {}; |
| 5 | |
| 6 | struct example {}; |
| 7 | |
| 8 | template< typename > |
| 9 | struct helper |
| 10 | { |
| 11 | static constexpr auto c() { return 42; } |
| 12 | }; |
| 13 | |
| 14 | struct impostor_c |
| 15 | { |
| 16 | template< typename T, auto= helper< T >::c > |
| 17 | static example func(); |
| 18 | }; |
| 19 | |
| 20 | example c= impostor_c::func< token >(); |