[clang] [Clang] Treat address-of template substitution as SFINAE (PR #208062)
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 9 18:53:29 PDT 2026
================
@@ -4821,6 +4821,11 @@ TemplateDeductionResult Sema::DeduceTemplateArguments(
/*OriginalCallArgs=*/nullptr, /*PartialOverloading=*/false,
/*PartialOrdering=*/true, IsAddressOfFunction);
});
+ // [temp.deduct.funcaddr] uses the function template's function type when
----------------
yxsamliu wrote:
Done. I reformatted the comment to quote the standard prose directly, in the usual `C++ [section]pN:` block-quote style. It now quotes [temp.deduct.funcaddr]p1 for why the function type is substituted, [temp.deduct.general]p7 for substitution into expressions like the return type, [dcl.fct.def.delete]p2 for why designating a deleted function is ill-formed, and [temp.deduct.general]p8 for why an invalid expression in the immediate context is a deduction failure rather than a hard error. That last quote is what justifies returning SubstitutionFailure here.
https://github.com/llvm/llvm-project/pull/208062
More information about the cfe-commits
mailing list