From: Douglas Gregor Date: Fri, 29 Apr 2011 01:38:03 +0000 (+0000) Subject: libstdc++ 4.2 also uses __is_same as a struct name, which conflicts with our new... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=877222e2491bbc40a5c74cc100c540983f306b70;p=clang libstdc++ 4.2 also uses __is_same as a struct name, which conflicts with our new type trait __is_same git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130468 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 92cdfffdc0..30dc50077a 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -738,7 +738,8 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, Tok.is(tok::kw___is_pointer) || Tok.is(tok::kw___is_arithmetic) || Tok.is(tok::kw___is_fundamental) || - Tok.is(tok::kw___is_scalar))) { + 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 diff --git a/test/SemaCXX/libstdcxx_is_pod_hack.cpp b/test/SemaCXX/libstdcxx_is_pod_hack.cpp index 3cc476dc28..01f0532c1d 100644 --- a/test/SemaCXX/libstdcxx_is_pod_hack.cpp +++ b/test/SemaCXX/libstdcxx_is_pod_hack.cpp @@ -12,6 +12,13 @@ struct __is_pod { __is_pod ipi; +// Ditto for __is_same. +template +struct __is_same { +}; + +__is_same ipi; + // Another, similar egregious hack for __is_signed, which is a type // trait in Embarcadero's compiler but is used as an identifier in // libstdc++.