1 // P1064R0 2 // { dg-do compile } 3 // { dg-options "-std=c++2a" } 4 5 struct X1 6 { fX17 constexpr virtual X1 const *f() const { return this; } 8 }; 9 10 struct Y 11 { 12 int m = 0; 13 }; 14 15 struct X2: public Y, public X1 16 { fX217 constexpr virtual X2 const *f() const { return this; } 18 }; 19 20 constexpr X1 x1; 21 static_assert(x1.f() == &x1); 22 23 constexpr X2 x2; 24 constexpr X1 const& r2 = x2; 25 static_assert(r2.f() == &r2); 26