From: Douglas Gregor Date: Thu, 20 Oct 2011 20:40:00 +0000 (+0000) Subject: When fixing up the storage class for an anonymous union, don't mark X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef47d27b9c76ed2f20e6c342e66b5450ef7e96ee;p=clang When fixing up the storage class for an anonymous union, don't mark 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 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index eff21cb12b..f4c5237ff2 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2655,7 +2655,6 @@ Decl *Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS, cast(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,