libstdc++ 4.2 also uses __is_same as a struct name, which conflicts with our new type trait __is_same
llvm-svn: 130468
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index 92cdfff..30dc500 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -738,7 +738,8 @@
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/clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp b/clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
index 3cc476d..01f0532 100644
--- a/clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
+++ b/clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
@@ -12,6 +12,13 @@
__is_pod<int> ipi;
+// Ditto for __is_same.
+template<typename T>
+struct __is_same {
+};
+
+__is_same<int> 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++.