[cfe-commits] r130468 - in /cfe/trunk: lib/Parse/ParseDeclCXX.cpp test/SemaCXX/libstdcxx_is_pod_hack.cpp
Douglas Gregor
dgregor at apple.com
Thu Apr 28 18:38:03 PDT 2011
Author: dgregor
Date: Thu Apr 28 20:38:03 2011
New Revision: 130468
URL: http://llvm.org/viewvc/llvm-project?rev=130468&view=rev
Log:
libstdc++ 4.2 also uses __is_same as a struct name, which conflicts with our new type trait __is_same
Modified:
cfe/trunk/lib/Parse/ParseDeclCXX.cpp
cfe/trunk/test/SemaCXX/libstdcxx_is_pod_hack.cpp
Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=130468&r1=130467&r2=130468&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Thu Apr 28 20:38:03 2011
@@ -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
Modified: cfe/trunk/test/SemaCXX/libstdcxx_is_pod_hack.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/libstdcxx_is_pod_hack.cpp?rev=130468&r1=130467&r2=130468&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/libstdcxx_is_pod_hack.cpp (original)
+++ cfe/trunk/test/SemaCXX/libstdcxx_is_pod_hack.cpp Thu Apr 28 20:38:03 2011
@@ -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++.
More information about the cfe-commits
mailing list