================
@@ -1767,13 +1767,18 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D,
   TypeSourceInfo *TSI = SemaRef.SubstType(
       D->getTypeSourceInfo(), TemplateArgs, D->getTypeSpecStartLoc(),
       D->getDeclName(), /*AllowDeducedTST*/ true);
-  if (!TSI)
-    return nullptr;
-
-  if (TSI->getType()->isFunctionType()) {
+  bool Invalid = false;
+  if (!TSI) {
+    if (!InstantiatingVarTemplate)
+      return nullptr;
+    TSI = D->getTypeSourceInfo();
----------------
iamaayushrivastava wrote:

Understood. I've made the fix using 
SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.Context.IntTy, 
D->getLocation()) as the recovery type.

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