Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/constexpr-ice21.C

raw
1 // PR c++/118225
2 // { dg-do "compile" { target c++11} }
3
4 struct NoMut1 { int a, b; };
5 struct NoMut3 : virtual NoMut1 {
6 constexpr NoMut3(int a, int b)
7 : NoMut1{a, b}
8 {} // { dg-error "virtual base" }
9 };
10 void mutable_subobjects() {
11 constexpr NoMut3 nm3 = {1, 2}; // { dg-error "call to non" }
12 struct A {
13 void f() {
14 static_assert(nm3.a == 1, ""); // { dg-error "local variable" }
15 }
16 };
17 }