testsuite: update mangling
[official-gcc.git] / gcc / testsuite / g++.dg / cpp2a / constexpr-virtual11.C
blobf7b46d3098ffde94669d13bd6c9a07bbc171a04f
1 // P1064R0
2 // { dg-do compile }
3 // { dg-options "-std=c++2a" }
5 struct A
7   constexpr virtual int f () const { return 1; }
8 };
10 struct B : public A
12   constexpr virtual int f () const { return 2; }
15 struct C
17   A a;
18   B b;
21 constexpr C c;
22 constexpr const A &d = c.a;
23 constexpr const A &e = c.b;
24 constexpr const B &f = c.b;
25 static_assert (c.a.f () == 1 && c.b.f () == 2);
26 static_assert (d.f () == 1 && e.f () == 2 && f.f () == 2);