================
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to