https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92695
--- Comment #1 from Toni Neubert <lutztonineubert at gmail dot com> --- Future more, the following example also fails. Could be the same root cause but another error message appears: accessing value of 'f.Foo::b[0].B::<anonymous>' through a 'B' glvalue in a constant expression Clang is just fine with it. ``` struct A { constexpr virtual int get() = 0; constexpr virtual int set(A *o) = 0; }; struct B : A { constexpr int get() override { return 10; }struct A { constexpr virtual int get() = 0; constexpr virtual int set(A *o) = 0; }; struct B : A { constexpr int get() override { return 10; } constexpr int set(A *o) override { a = o; return 20; } A *a{}; }; constexpr auto addressof = [](A &n) { return &n; }; struct Foo { B b[1]; A* curr_{addressof(b[0])}; constexpr int add() { return curr_->set(addressof(b[0])); } }; constexpr int get() { Foo f; return f.add(); } constexpr auto a = get(); int main() { return a; } constexpr int set(A *o) override { a = o; return 20; } A *a{}; }; constexpr auto addressof = [](A &n) { return &n; }; struct Foo { B b[1]; A* curr_{addressof(b[0])}; constexpr int add() { return curr_->set(addressof(b[0])); } }; constexpr int get() { Foo f; return f.add(); } constexpr auto a = get(); int main() { return a; } ``` See online here: https://gcc.godbolt.org/z/4ZwFAN