summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2018-10-24 12:26:23 +0000
committerAaron Ballman <aaron@aaronballman.com>2018-10-24 12:26:23 +0000
commitad672ffb643c646ca7680c765342bd58252ecdbe (patch)
tree983949541e2d1345350ca5f6f01833b6db7a09da /clang/lib/Parse/ParseDeclCXX.cpp
parentc4a995c8e05bd63932677ee30e4f4cfd6623eaff (diff)
downloadbcm5719-llvm-ad672ffb643c646ca7680c765342bd58252ecdbe.tar.gz
bcm5719-llvm-ad672ffb643c646ca7680c765342bd58252ecdbe.zip
Support accepting __gnu__ as a scoped attribute namespace that aliases to gnu.
This is useful in libstdc++ to avoid clashes with identifiers in the user's namespace. llvm-svn: 345132
Diffstat (limited to 'clang/lib/Parse/ParseDeclCXX.cpp')
-rw-r--r--clang/lib/Parse/ParseDeclCXX.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index a86f7ed8642..63e7179a74c 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -3865,13 +3865,14 @@ bool Parser::ParseCXX11AttributeArgs(IdentifierInfo *AttrName,
// Eat the left paren, then skip to the ending right paren.
ConsumeParen();
SkipUntil(tok::r_paren);
- return false;
- }
-
- if (ScopeName && ScopeName->getName() == "gnu") {
- // GNU-scoped attributes have some special cases to handle GNU-specific
- // behaviors.
- ParseGNUAttributeArgs(AttrName, AttrNameLoc, Attrs, EndLoc, ScopeName,
+ return false;
+ }
+
+ if (ScopeName &&
+ (ScopeName->getName() == "gnu" || ScopeName->getName() == "__gnu__")) {
+ // GNU-scoped attributes have some special cases to handle GNU-specific
+ // behaviors.
+ ParseGNUAttributeArgs(AttrName, AttrNameLoc, Attrs, EndLoc, ScopeName,
ScopeLoc, Syntax, nullptr);
return true;
}
OpenPOWER on IntegriCloud