blob: 9eb72b96de99dff6bd7a6b41f29e6d81386c5d96 [file] [log] [blame]
// PR c++/103879
// { dg-do compile { target c++14 } }
struct A { int n = 42; };
struct Y { int m = 0; };
struct X : Y, A { };
struct B : X { };
struct C { B b; };
constexpr int f() {
C c;
A& a = static_cast<A&>(c.b);
B& b = static_cast<B&>(a);
return b.n;
}
static_assert(f() == 42, "");