OSDN Git Service

* call.c (null_ptr_cst_p): Use maybe_constant_value.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-static3.C
1 // Test for constant initialization of class with vtable
2 // { dg-options "-std=c++0x -save-temps" }
3 // { dg-final { scan-assembler-not "static_initialization" } }
4 // { dg-final cleanup-saved-temps }
5 // { dg-do run }
6
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; } };
11
12 B b;
13
14 int main()
15 {
16   b.f();
17   return r;
18 }