================
@@ -1070,10 +1070,8 @@ bool Sema::CheckCXXThrowOperand(SourceLocation ThrowLoc,
 
       // We don't keep the instantiated default argument expressions around so
       // we must rebuild them here.
-      for (unsigned I = 1, E = CD->getNumParams(); I != E; ++I) {
-        if (CheckCXXDefaultArgExpr(ThrowLoc, CD, CD->getParamDecl(I)))
-          return true;
-      }
+      if (BuildCtorClosureDefaultArgs(ThrowLoc, CD, /*IsCopy=*/true))
----------------
zmodem wrote:

If you mean why don't we check/build the default arg already at the copy 
constructor definition point, I suppose we don't know at that point whether 
we'll need them. 

BuildCtorClosureDefaultArgs() has a check that we don't build the arguments 
twice.

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

Reply via email to