[clang] [clang] fix partial ordering of NTTP packs (PR #134461)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 13 14:20:27 PDT 2025


================
@@ -7085,18 +7102,24 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
                                    ? Context.getIntWidth(IntegerType)
                                    : Context.getTypeSize(IntegerType));
 
-      SugaredConverted = TemplateArgument(Context, Value, ParamType);
-      CanonicalConverted =
-          TemplateArgument(Context, Value, Context.getCanonicalType(ParamType));
-      return ArgResult;
+      if (ArgPE) {
----------------
shafik wrote:

So we had a static analysis tool claim that if we get there `ArgPE` will always be `nullptr` based on just manual inspection it was not clear to me this was the case. 

So I decided to change the code based on this assumption and see if anything breaks and nothing broke.

At minimum we are not covering this code in testing which is not ideal. Can you come up with a test case that hits this or maybe show that this indeed dead code?

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


More information about the cfe-commits mailing list