================
@@ -3232,18 +3239,36 @@ static bool canUseCtorHoming(const CXXRecordDecl *RD) {
   if (isClassOrMethodDLLImport(RD))
     return false;
 
-  if (RD->isLambda() || RD->isAggregate() ||
-      RD->hasTrivialDefaultConstructor() ||
-      RD->hasConstexprNonCopyMoveConstructor())
+  if (RD->isLambda() || RD->isAggregate() || 
RD->hasTrivialDefaultConstructor())
+    return false;
+
+  // Skip this optimization if the class has a constexpr default constructor,
+  // since those constructors can be invoked without emitting type information
+  // for the constructor.
+  if (RD->needsImplicitDefaultConstructor() &&
+      RD->defaultedDefaultConstructorIsConstexpr())
     return false;
 
+  bool HasNonDeletedCtor = false;
   for (const CXXConstructorDecl *Ctor : RD->ctors()) {
     if (Ctor->isCopyOrMoveConstructor())
       continue;
+    const FunctionDecl *Def = nullptr;
+    if (Ctor->isDefined(Def)) {
----------------
ClaytonKnittel wrote:

Done.

https://github.com/llvm/llvm-project/pull/218165
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to