From 106b53472df23d53b133ca3144d8280b73fa331b Mon Sep 17 00:00:00 2001 From: zebullax Date: Fri, 31 Oct 2025 18:11:27 +0900 Subject: [PATCH] Check against function in template_argument_of (#199) --- clang/lib/AST/ExprConstantMeta.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/AST/ExprConstantMeta.cpp b/clang/lib/AST/ExprConstantMeta.cpp index 15478d1cfd9f..78d0e8ad2125 100644 --- a/clang/lib/AST/ExprConstantMeta.cpp +++ b/clang/lib/AST/ExprConstantMeta.cpp @@ -1876,7 +1876,7 @@ bool get_ith_template_argument_of(APValue &Result, ASTContext &C, return DiagnoseReflectionKind(Diagnoser, Range, "a template specialization"); APValue R = getNthTemplateArgument(C, TArgs, Evaluator, Sentinel, idx); - if (R.isReflectedDecl()) + if (R.isReflectedDecl() && !isa(R.getReflectedDecl())) R = APValue(APValue::LValueBase{R.getReflectedDecl()}, CharUnits::Zero(), {}, false, false).Lift(QualType{}); return SetAndSucceed(Result, R);