[clang] [Clang] Implement CWG2900 (PR #224291)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 29 08:52:18 PDT 2026


================
@@ -5566,6 +5566,22 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param, TemplateArgumentLoc &ArgLoc,
     if (NTTP->isParameterPack() && NTTP->isExpandedParameterPack())
       NTTPType = NTTP->getExpansionType(ArgumentPackIndex);
 
+    // C++26 [dcl.type.auto.deduct]p3:
+    //   If the placeholder-type-specifier is of the form type-constraint_opt
+    //   auto, [...] If E is a value synthesized for a constant template
+    //   parameter of type decltype(auto) ([temp.func.order]), the declaration
+    //   is ill-formed.
+    auto isUndeducedAuto = [](QualType T, bool DecltypeAuto) {
+      const AutoType *AT = T->getContainedAutoType();
----------------
AaronBallman wrote:

Are we expecting this to assert on a null `QualType`?

`Sema::getTypeOfConstantTemplateParameter()` returns `QualType()` and the `T->` will assert in that case.

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


More information about the cfe-commits mailing list