[clang] Reland [Clang] skip default argument instantiation for non-defining friend declarations to meet [dcl.fct.default] p4 (PR #115487)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 26 05:21:39 PST 2024


================
@@ -4692,6 +4692,17 @@ bool Sema::InstantiateDefaultArgument(SourceLocation CallLoc, FunctionDecl *FD,
                                       ParmVarDecl *Param) {
   assert(Param->hasUninstantiatedDefaultArg());
 
+  // FIXME: We don't track member specialization info for non-defining
+  // friend declarations, so we will not be able to later find the function
+  // pattern. As a workaround, don't instantiate the default argument in this
+  // case. This is correct per wording and only an error recovery issue, as per
----------------
erichkeane wrote:

I'm not sure I get the FIXME here, if the reason for keeping this around would be improved error recovery/recovery-expr, should we just be producing one of those instead?  If not, what anticipated action do we have here to fix this in the future?  And what would be the benefit?

https://github.com/llvm/llvm-project/pull/115487


More information about the cfe-commits mailing list