gcc/testsuite/g++.dg/cpp1z/inline-var5.C
raw| 1 | // PR c++/89405 |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | // { dg-options "-fno-weak" } |
| 4 | |
| 5 | template <int N> |
| 6 | struct S |
| 7 | { |
| 8 | static constexpr int a = N; // { dg-warning "semantics of inline variable" } |
| 9 | }; // { dg-message "you can work around this" "" { target *-*-* } .-1 } |
| 10 | |
| 11 | const int *x = &S<0>::a; |