================
@@ -4802,7 +4802,10 @@ Sema::BuildDelegatingInitializer(TypeSourceInfo *TInfo,
Expr *Init,
ExprResult DelegationInit = InitSeq.Perform(*this, DelegationEntity, Kind,
Args, nullptr);
if (!DelegationInit.isInvalid()) {
+ // If all user-provided constructors are invalid the class is still an
+ // aggregate, and the delegation is an aggregate initialization instead.
assert((DelegationInit.get()->containsErrors() ||
+ ClassDecl->isAggregate() ||
----------------
akash-manna-sky wrote:
Removed the assertion for now. Checking "all constructors invalid" is slightly
odd here: `LookupDefaultConstructor` has already declared the implicit default
constructor by this point I think, and the `containsErrors()` escape would
still be needed. Failing earlier would add a second "no matching constructor"
error on a constructor that is already diagnosed.
https://github.com/llvm/llvm-project/pull/220830
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits