[clang] [AMDGPU] Fix builtin crash with template parameter size argument (PR #175767)

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 13 06:48:54 PST 2026


================
@@ -44,6 +44,10 @@ bool SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID,
     constexpr const int SizeIdx = 2;
     llvm::APSInt Size;
     Expr *ArgExpr = TheCall->getArg(SizeIdx);
+    // Check for value-dependent expressions (e.g., template parameters).
+    // These will be checked again during template instantiation.
+    if (ArgExpr->isValueDependent())
----------------
shiltian wrote:

I learned from another PR that, in this case, we should use `isInstantiationDependent` instead of `isValueDependent`.

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


More information about the cfe-commits mailing list