]> granicus.if.org Git - clang/commitdiff
Mark a non-type template parameter invalid if there was a problem with its type
authorDouglas Gregor <dgregor@apple.com>
Mon, 9 Mar 2009 16:46:39 +0000 (16:46 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 9 Mar 2009 16:46:39 +0000 (16:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66422 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplate.cpp

index ed50722d2fac7506794bc715b840e42b968531e7..a55e3a5184578efeb8602c6c6181925415410f78 100644 (file)
@@ -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(),