From: David Blaikie Date: Thu, 20 Oct 2011 02:49:08 +0000 (+0000) Subject: FixIt insert 'static' for anonymous unions at global or namespace scope. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82c8ca1eeba6ccdf34916803150df369df3b7ae5;p=clang FixIt insert 'static' for anonymous unions at global or namespace scope. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142566 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 8d9785019c..bccb63eede 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2653,7 +2653,8 @@ Decl *Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS, (isa(Owner) || (isa(Owner) && cast(Owner)->getDeclName()))) { - Diag(Record->getLocation(), diag::err_anonymous_union_not_static); + Diag(Record->getLocation(), diag::err_anonymous_union_not_static) + << FixItHint::CreateInsertion(Record->getLocation(), "static "); Invalid = true; // Recover by adding 'static'.