From b10c92001ccaaeda5154d5c20c23fdaf18f8d9c3 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 24 Sep 2014 03:28:54 +0000 Subject: Follow-up to r218292: Add more REVERTIBLE_TYPE_TRAITs. r218292 reverted r197496 because it broke things. In addition to breaking things, r197496 also made all traits starting with __is_ revertible. Reinstantiate that part of r197496 because code out there (e.g. libc++) depends on this behavior. Fixes PR21045. llvm-svn: 218365 --- clang/lib/Parse/ParseDeclCXX.cpp | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'clang/lib/Parse/ParseDeclCXX.cpp') diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index 8ea53966946..08f73d4d09b 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -1229,22 +1229,55 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, if (TagType == DeclSpec::TST_struct && !Tok.is(tok::identifier) && Tok.getIdentifierInfo() && - (Tok.is(tok::kw___is_arithmetic) || + (Tok.is(tok::kw___is_abstract) || + Tok.is(tok::kw___is_arithmetic) || + Tok.is(tok::kw___is_array) || + Tok.is(tok::kw___is_base_of) || + Tok.is(tok::kw___is_class) || + Tok.is(tok::kw___is_complete_type) || + Tok.is(tok::kw___is_compound) || + Tok.is(tok::kw___is_const) || + Tok.is(tok::kw___is_constructible) || Tok.is(tok::kw___is_convertible) || + Tok.is(tok::kw___is_convertible_to) || + Tok.is(tok::kw___is_destructible) || Tok.is(tok::kw___is_empty) || + Tok.is(tok::kw___is_enum) || Tok.is(tok::kw___is_floating_point) || + Tok.is(tok::kw___is_final) || Tok.is(tok::kw___is_function) || Tok.is(tok::kw___is_fundamental) || Tok.is(tok::kw___is_integral) || + Tok.is(tok::kw___is_interface_class) || + Tok.is(tok::kw___is_literal) || + Tok.is(tok::kw___is_lvalue_expr) || + Tok.is(tok::kw___is_lvalue_reference) || Tok.is(tok::kw___is_member_function_pointer) || + Tok.is(tok::kw___is_member_object_pointer) || Tok.is(tok::kw___is_member_pointer) || + Tok.is(tok::kw___is_nothrow_assignable) || + Tok.is(tok::kw___is_nothrow_constructible) || + Tok.is(tok::kw___is_nothrow_destructible) || + Tok.is(tok::kw___is_object) || Tok.is(tok::kw___is_pod) || Tok.is(tok::kw___is_pointer) || + Tok.is(tok::kw___is_polymorphic) || + Tok.is(tok::kw___is_reference) || + Tok.is(tok::kw___is_rvalue_expr) || + Tok.is(tok::kw___is_rvalue_reference) || Tok.is(tok::kw___is_same) || Tok.is(tok::kw___is_scalar) || + Tok.is(tok::kw___is_sealed) || Tok.is(tok::kw___is_signed) || + Tok.is(tok::kw___is_standard_layout) || + Tok.is(tok::kw___is_trivial) || + Tok.is(tok::kw___is_trivially_assignable) || + Tok.is(tok::kw___is_trivially_constructible) || + Tok.is(tok::kw___is_trivially_copyable) || + Tok.is(tok::kw___is_union) || Tok.is(tok::kw___is_unsigned) || - Tok.is(tok::kw___is_void))) + Tok.is(tok::kw___is_void) || + Tok.is(tok::kw___is_volatile))) // GNU libstdc++ 4.2 and libc++ use 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 -- cgit v1.2.3