From 82c8ca1eeba6ccdf34916803150df369df3b7ae5 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 20 Oct 2011 02:49:08 +0000 Subject: [PATCH] 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 --- lib/Sema/SemaDecl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'. -- 2.50.1