зеркало из https://github.com/microsoft/clang-1.git
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
This commit is contained in:
Родитель
f6f876cb08
Коммит
82c8ca1eeb
|
@ -2653,7 +2653,8 @@ Decl *Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
|
||||||
(isa<TranslationUnitDecl>(Owner) ||
|
(isa<TranslationUnitDecl>(Owner) ||
|
||||||
(isa<NamespaceDecl>(Owner) &&
|
(isa<NamespaceDecl>(Owner) &&
|
||||||
cast<NamespaceDecl>(Owner)->getDeclName()))) {
|
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;
|
Invalid = true;
|
||||||
|
|
||||||
// Recover by adding 'static'.
|
// Recover by adding 'static'.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче