Mark a non-type template parameter invalid if there was a problem with its type
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66422 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index ed50722..a55e3a5 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -230,8 +230,10 @@
}
T = CheckNonTypeTemplateParameterType(T, D.getIdentifierLoc());
- if (T.isNull())
+ if (T.isNull()) {
T = Context.IntTy; // Recover with an 'int' type.
+ Invalid = true;
+ }
NonTypeTemplateParmDecl *Param
= NonTypeTemplateParmDecl::Create(Context, CurContext, D.getIdentifierLoc(),