https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110828
--- Comment #2 from Björn Fahller <gccbugbjorn at fahller dot se> --- If I write it in the same way in a function, it compiles. consteval auto f() { return S{}.f(); } constexpr auto b = f(); However, if I break it into a constexpr object S s; and return s.f(), it does not compile, this time because the construction of 's' fails because it refers to an unititialized variable, regardless of whether the member is an array or not. union type { constexpr type(){} constexpr ~type() {} int t; }; struct S { constexpr S() {} constexpr bool f() const { return true;} type v{}; }; consteval auto f() { constexpr S s; return s.f(); } constexpr auto b = f(); https://godbolt.org/z/68zY6ecxs