================
@@ -1842,6 +1848,9 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D,
   if (SemaRef.getLangOpts().OpenACC)
     SemaRef.OpenACC().ActOnVariableDeclarator(Var);
 
+  if (Invalid)
+    Var->setInvalidDecl();
----------------
iamaayushrivastava wrote:

> Thanks, that's better.
> 
> Though you don't really need to separately track the invalid state in a bool 
> and then set it later.
> 
> `setInvalidDecl` is just changing a bit in a bitfield in the decl, please 
> update to use that directly.

Thanks! Removed the `bool Invalid`, now saving the raw `SubstType` result as 
`SubstTSI` and calling `Var->setInvalidDecl()` directly right after `Var` is 
created by checking `!SubstTSI || SubstTSI->getType()->isFunctionType()`.

https://github.com/llvm/llvm-project/pull/200161
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to