]> granicus.if.org Git - clang/commitdiff
When fixing up the storage class for an anonymous union, don't mark
authorDouglas Gregor <dgregor@apple.com>
Thu, 20 Oct 2011 20:40:00 +0000 (20:40 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 20 Oct 2011 20:40:00 +0000 (20:40 +0000)
the anonymous union as valid: our fixes have Fix-Its.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142616 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index eff21cb12bb23898f4ab8abf227d0d5763823ff2..f4c5237ff2b6386790ed0788caf4b222e4f575b6 100644 (file)
@@ -2655,7 +2655,6 @@ Decl *Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
             cast<NamespaceDecl>(Owner)->getDeclName()))) {
         Diag(Record->getLocation(), diag::err_anonymous_union_not_static)
           << FixItHint::CreateInsertion(Record->getLocation(), "static ");
-        Invalid = true;
   
         // Recover by adding 'static'.
         DS.SetStorageClassSpec(*this, DeclSpec::SCS_static, SourceLocation(),
@@ -2669,7 +2668,6 @@ Decl *Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
         Diag(DS.getStorageClassSpecLoc(),
              diag::err_anonymous_union_with_storage_spec)
           << FixItHint::CreateRemoval(DS.getStorageClassSpecLoc());
-        Invalid = true;
   
         // Recover by removing the storage specifier.
         DS.SetStorageClassSpec(*this, DeclSpec::SCS_unspecified,