summaryrefslogtreecommitdiff
path: root/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
commit589b42244bedcf5d2803feea65e02245fc1de341 (patch)
tree7a1abca0efd9fdee4f5efa49c291ede9ce1841e7 /lib/Parse/ParseDeclCXX.cpp
parentb06c0831376fdaa2ddce2110d57e7d5369db5bb8 (diff)
downloadclang-589b42244bedcf5d2803feea65e02245fc1de341.tar.gz
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r--lib/Parse/ParseDeclCXX.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index a86f7ed864..63e7179a74 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/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;
}