Daily bump.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-odr2.C
blobdd569a96ba672c721286b8a3ab67f0fe4e199b32
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" }
5 template<int> struct A {
6   static const bool x;
7   enum { force_instantiation =! &x}; // odr-uses A<...>::x
8 };
10 int g;
12 template<int I>
13 const bool A<I>::x = (g = 42, false);
15 void f(A<0>) {}        // A<0> must be complete, so is instantiated
16 int main()
18   if (g != 42)
19     __builtin_abort ();