summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-04-29 15:31:39 +0000
committerDouglas Gregor <dgregor@apple.com>2011-04-29 15:31:39 +0000
commitf1fce5d3ef31a1db27a8844fa8b5727f08dc21b3 (patch)
tree0d05f39856526eeff4ccd87432b500692222c542 /clang/lib/Parse/ParseDeclCXX.cpp
parent1fc5bf9fc55caeba79695bfa96ca4324f5bc87b7 (diff)
downloadbcm5719-llvm-f1fce5d3ef31a1db27a8844fa8b5727f08dc21b3.tar.gz
bcm5719-llvm-f1fce5d3ef31a1db27a8844fa8b5727f08dc21b3.zip
White-list yet more type trait names, since they're used as
identifiers in libc++. llvm-svn: 130508
Diffstat (limited to 'clang/lib/Parse/ParseDeclCXX.cpp')
-rw-r--r--clang/lib/Parse/ParseDeclCXX.cpp30
1 files changed, 20 insertions, 10 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index 30dc50077a7..df2d214cb93 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -732,19 +732,29 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
MaybeParseCXX0XAttributes(attrs);
if (TagType == DeclSpec::TST_struct &&
- (Tok.is(tok::kw___is_pod) ||
+ !Tok.is(tok::identifier) &&
+ Tok.getIdentifierInfo() &&
+ (Tok.is(tok::kw___is_arithmetic) ||
+ Tok.is(tok::kw___is_convertible) ||
Tok.is(tok::kw___is_empty) ||
- Tok.is(tok::kw___is_void) ||
- Tok.is(tok::kw___is_pointer) ||
- Tok.is(tok::kw___is_arithmetic) ||
+ Tok.is(tok::kw___is_floating_point) ||
+ Tok.is(tok::kw___is_function) ||
Tok.is(tok::kw___is_fundamental) ||
+ Tok.is(tok::kw___is_integral) ||
+ Tok.is(tok::kw___is_member_function_pointer) ||
+ Tok.is(tok::kw___is_member_pointer) ||
+ Tok.is(tok::kw___is_pod) ||
+ Tok.is(tok::kw___is_pointer) ||
+ Tok.is(tok::kw___is_same) ||
Tok.is(tok::kw___is_scalar) ||
- Tok.is(tok::kw___is_same))) {
- // GNU libstdc++ 4.2 uses certain intrinsic names as the name of
- // struct templates, but these are keywords in GCC >= 4.3 and
- // Clang. Therefore, when we see the token sequence "struct X", make
- // X into a normal identifier rather than a keyword, to allow
- // libstdc++ 4.2 to work properly.
+ Tok.is(tok::kw___is_signed) ||
+ Tok.is(tok::kw___is_unsigned) ||
+ Tok.is(tok::kw___is_void))) {
+ // GNU libstdc++ 4.2 and libc++ uaw certain intrinsic names as the
+ // name of struct templates, but some are keywords in GCC >= 4.3
+ // and Clang. Therefore, when we see the token sequence "struct
+ // X", make X into a normal identifier rather than a keyword, to
+ // allow libstdc++ 4.2 and libc++ to work properly.
Tok.getIdentifierInfo()->RevertTokenIDToIdentifier();
Tok.setKind(tok::identifier);
}
OpenPOWER on IntegriCloud