================
@@ -6018,6 +6018,13 @@ bool Sema::GatherArgumentsForCall(SourceLocation 
CallLoc, FunctionDecl *FDecl,
     } else {
       assert(Param && "can't use default arguments without a known callee");
 
+      // C++ [dcl.fct.default]p4
+      //   If a friend declaration D specifies a default argument expression,
+      //   that declaration shall be a definition.
----------------
mizvekov wrote:

```suggestion
      // 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 
[dcl.fct.default]p4,
      // "if a friend declaration D specifies a default argument expression,
      // that declaration shall be a definition."
```
As the way it was stated before, the comment gave the impression that it was 
implementing that wording. But that is done elsewhere. Here we are just using 
the wording to justify a workaround.


https://github.com/llvm/llvm-project/pull/113777
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to