Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git] / main / gcc / testsuite / g++.dg / cpp0x / constexpr-static3.C
blob6d65a62e5aba8fa187c307be0561a12adedc0bf9
1 // Test for constant initialization of class with vtable
2 // { dg-options "-save-temps" }
3 // { dg-final { scan-assembler-not "static_initialization" } }
4 // { dg-final cleanup-saved-temps }
5 // { dg-do run { target c++11 } }
7 int r = 1;
8 // implicit default constructor for A and B is constexpr
9 struct A { virtual void f() {} };
10 struct B: A { virtual void f() { r = 0; } };
12 B b;
14 int main()
16   b.f();
17   return r;