blob: a267c14bc8024d516b3404c5be70e27a3623404b [file] [log] [blame]
// PR c++/103879
// { dg-do compile { target c++14 } }
struct A { int n = 42; };
struct B : A { };
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, "");