================
@@ -8508,6 +8507,16 @@ Sema::BuildExpressionFromDeclTemplateArgument(const 
TemplateArgument &Arg,
   } else {
     assert(ParamType->isReferenceType() &&
            "unexpected type for decl template argument");
+    if (ParamType->isLValueReferenceType())
+      if (NonTypeTemplateParmDecl *NTTP =
+              dyn_cast_if_present<NonTypeTemplateParmDecl>(TemplateParam)) {
+        QualType TemplateParamType = NTTP->getType();
+        const AutoType *AT = TemplateParamType->getAs<AutoType>();
+        if (AT && AT->isDecltypeAuto())
+          RefExpr = new (getASTContext())
+              ParenExpr(RefExpr.get()->getBeginLoc(),
----------------
jcsxky wrote:

Ah, thanks for your remind! `SubstNonTypeTemplateParmExpr` is more suitable 
here.

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

Reply via email to