[clang] [clang-tools-extra] [Clang][Sema] Fix explicit specializations of member function templates with a deduced return type (PR #86817)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 28 11:05:56 PDT 2024


================
@@ -12107,6 +12090,35 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
 
   CheckConstPureAttributesUsage(*this, NewFD);
 
+  // C++23 [dcl.spec.auto.general]p12:
+  //   Return type deduction for a templated function with a placeholder in its
+  //   declared type occurs when the definition is instantiated even if the
+  //   function body contains a return statement with a non-type-dependent
+  //   operand.
----------------
Sirraide wrote:

I’d just write ‘C++’ instead of ‘C++23’, because this is making it sound (to me at least) like this rule was added in C++23, when it in fact goes all the way back to C++14.

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


More information about the cfe-commits mailing list