aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2011-10-20 02:49:08 +0000
committerDavid Blaikie <dblaikie@gmail.com>2011-10-20 02:49:08 +0000
commit82c8ca1eeba6ccdf34916803150df369df3b7ae5 (patch)
tree797d7af720b9f2e9e0c8d1fadf55173b30e8d067 /lib/Sema/SemaDecl.cpp
parentf6f876cb08449febc43a6baf7720b256846d01dc (diff)
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
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp3
1 files changed, 2 insertions, 1 deletions
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<TranslationUnitDecl>(Owner) ||
(isa<NamespaceDecl>(Owner) &&
cast<NamespaceDecl>(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'.