[cfe-commits] r147864 - /cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Douglas Gregor dgregor at apple.com
Tue Jan 10 14:36:09 PST 2012


On Jan 10, 2012, at 10:26 AM, Chandler Carruth wrote:

> Author: chandlerc
> Date: Tue Jan 10 12:26:14 2012
> New Revision: 147864
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=147864&view=rev
> Log:
> Remove a set, but unused variable. Found with GCC's warning.

Oops. This is fallout from my recent work on namespace redeclaration chains. I should have been checking IsInvalid later and setting the Invalid bit on the resulting Decl. Fixed in r147882.

	- Doug

> Modified:
>    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
> 
> Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=147864&r1=147863&r2=147864&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Tue Jan 10 12:26:14 2012
> @@ -5532,7 +5532,6 @@
>   // For anonymous namespace, take the location of the left brace.
>   SourceLocation Loc = II ? IdentLoc : LBrace;
>   bool IsInline = InlineLoc.isValid();
> -  bool IsInvalid = false;
>   bool IsStd = false;
>   bool AddToKnown = false;
>   Scope *DeclRegionScope = NamespcScope->getParent();
> @@ -5587,7 +5586,6 @@
>       Diag(Loc, diag::err_redefinition_different_kind)
>         << II;
>       Diag(PrevDecl->getLocation(), diag::note_previous_definition);
> -      IsInvalid = true;
>       // Continue on to push Namespc as current DeclContext and return it.
>     } else if (II->isStr("std") &&
>                CurContext->getRedeclContext()->isTranslationUnit()) {
> @@ -5617,8 +5615,7 @@
>       Diag(Loc, diag::err_inline_namespace_mismatch)
>         << IsInline;
>       Diag(PrevNS->getLocation(), diag::note_previous_definition);
> -      IsInvalid = true;
> -      
> +
>       // Recover by ignoring the new namespace's inline status.
>       IsInline = PrevNS->isInline();
>     }
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list