================ @@ -4694,6 +4694,15 @@ bool Sema::InstantiateDefaultArgument(SourceLocation CallLoc, FunctionDecl *FD, ParmVarDecl *Param) { assert(Param->hasUninstantiatedDefaultArg()); + // C++ [dcl.fct.default]p4 + // If a friend declaration D specifies a default argument expression, that + // declaration shall be a definition and there shall be no other declaration + // of the function or function template which is reachable from D or from + // which D is reachable. ---------------- mizvekov wrote:
```suggestion // declaration shall be a definition ... ``` This only concerns that first part of the rules. Though it's not exactly enforcing it, that's implemented somewhere else. So it might be worth pointing out that we are avoiding error recovery in this case due to implementation difficulties. 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