1 // PR c++/92062 - ODR-use ignored for static member of class template.
2 // { dg-do run { target c++11 } }
3 // { dg-additional-options "-fdelete-null-pointer-checks" }
4
5 template<int> struct A {
6 static const bool x;
7 enum { force_instantiation =! &x}; // odr-uses A<...>::x
8 };
9
10 int g;
11
12 template<int I>
13 const bool A<I>::x = (g = 42, false);
14
f(A<0>)15 void f(A<0>) {} // A<0> must be complete, so is instantiated
main()16 int main()
17 {
18 if (g != 42)
19 __builtin_abort ();
20 }
21