================
@@ -6387,8 +6387,22 @@ static void
checkForMultipleExportedDefaultConstructors(Sema &S,
if (!S.Context.getTargetInfo().getCXXABI().isMicrosoft())
return;
+ if (Class->isInvalidDecl())
+ return;
+
CXXConstructorDecl *LastExportedDefaultCtor = nullptr;
for (Decl *Member : Class->decls()) {
+ // Nested classes finish delayed default argument parsing with the
outermost
+ // class, so check each nested definition and class template pattern here.
+ CXXRecordDecl *NestedClass = dyn_cast<CXXRecordDecl>(Member);
+ if (auto *NestedTemplate = dyn_cast<ClassTemplateDecl>(Member))
+ NestedClass = NestedTemplate->getTemplatedDecl();
----------------
rnk wrote:
Please file an issue. I think there are some normal patterns you can follow
here:
- if class is dependent, skip
- during instantiation, call check for multiple default constructors, process
all classes that are fully non-dependent
https://github.com/llvm/llvm-project/pull/214275
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits