From: Nick Lewycky Date: Mon, 2 May 2011 01:48:46 +0000 (+0000) Subject: Remove redeclaration of Invalid. The code that set this to true was updating an X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e099c00a065c3a43706b8da71cfe655ff7a2c1c6;p=clang Remove redeclaration of Invalid. The code that set this to true was updating an Invalid that was never read from again, causing non-type-template-parms to be marked valid when in fact they weren't. This was caught by GCC 4.6's -Wunused-but-set-variable warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130680 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 5412d1325a..6e11ef5bbc 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -1605,7 +1605,6 @@ Decl *TemplateDeclInstantiator::VisitNonTypeTemplateParmDecl( return 0; // Check that this type is acceptable for a non-type template parameter. - bool Invalid = false; T = SemaRef.CheckNonTypeTemplateParameterType(DI->getType(), D->getLocation()); if (T.isNull()) {