gcc/testsuite/g++.dg/cpp1y/var-templ61.C
raw| 1 | // PR c++/89512 |
| 2 | // { dg-do compile { target c++14 } } |
| 3 | |
| 4 | struct A { |
| 5 | template <typename T> |
| 6 | static const int a = 0; |
| 7 | }; |
| 8 | |
| 9 | struct B { |
| 10 | template <typename T> |
| 11 | static int foo () |
| 12 | { |
| 13 | return T::a; // { dg-error "missing template arguments" } |
| 14 | } |
| 15 | }; |
| 16 | |
| 17 | int bar () |
| 18 | { |
| 19 | return B::foo<A> (); // { dg-message "required from here" } |
| 20 | } |