Check against function in template_argument_of (#199)

This commit is contained in:
zebullax
2025-10-31 18:11:27 +09:00
committed by GitHub
parent 08419a75ac
commit 106b53472d

View File

@@ -1876,7 +1876,7 @@ bool get_ith_template_argument_of(APValue &Result, ASTContext &C,
return DiagnoseReflectionKind(Diagnoser, Range, return DiagnoseReflectionKind(Diagnoser, Range,
"a template specialization"); "a template specialization");
APValue R = getNthTemplateArgument(C, TArgs, Evaluator, Sentinel, idx); APValue R = getNthTemplateArgument(C, TArgs, Evaluator, Sentinel, idx);
if (R.isReflectedDecl()) if (R.isReflectedDecl() && !isa<FunctionDecl>(R.getReflectedDecl()))
R = APValue(APValue::LValueBase{R.getReflectedDecl()}, CharUnits::Zero(), R = APValue(APValue::LValueBase{R.getReflectedDecl()}, CharUnits::Zero(),
{}, false, false).Lift(QualType{}); {}, false, false).Lift(QualType{});
return SetAndSucceed(Result, R); return SetAndSucceed(Result, R);