aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-09 16:46:39 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-09 16:46:39 +0000
commitceef30c9baef888dbf2cc2b3efc67c276f1fd815 (patch)
treed81912d9618e9abb1ba4654a9b09354b78d8b071 /lib/Sema/SemaTemplate.cpp
parent86447ec25fa34aa3c2f48ebc49ec09bc1f03f002 (diff)
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
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index ed50722d2f..a55e3a5184 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -230,8 +230,10 @@ Sema::DeclTy *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D,
}
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(),