================ @@ -1392,7 +1392,8 @@ class CXXRecordDecl : public RecordDecl { bool allowConstDefaultInit() const { return !data().HasUninitializedFields || !(data().HasDefaultedDefaultConstructor || - needsImplicitDefaultConstructor()); + needsImplicitDefaultConstructor()) || + hasInClassInitializer(); ---------------- zygoloid wrote:
What happens for: ``` struct A { union { struct { int n = 5; int m; }; }; }; const A a; ``` This is a language extension so we get to choose its semantics, but I think the most logical choice is to reject because the union member is not *fully* initialized. https://github.com/llvm/llvm-project/pull/96301 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits