summaryrefslogtreecommitdiff
path: root/test/SemaCXX
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-04 05:53:02 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-04 05:53:02 +0000
commitb117a60f7684261ddc8c8f14e8ef8a827e6af814 (patch)
tree3370eef9408e1e5367689e197a5d114304ecf0ba /test/SemaCXX
parente6585a7d71510be00a625686153f48d496d3bbf1 (diff)
downloadclang-b117a60f7684261ddc8c8f14e8ef8a827e6af814.tar.gz
Introduce an egregious hack to fix PR4828.
The problem this change addresses is that we treat __is_pod and __is_empty as keywords in C++, because they are built-in type traits in GCC >= 4.3. However, GNU libstdc++ 4.2 (and possibly earlier versions) define implementation-detail struct templates named __is_pod and __is_empty. This commit solves the problem by recognizing struct __is_pod and struct __is_empty as special token sequences. When one of these token sequences is encountered, the keyword (__is_pod or __is_empty) is implicitly downgraded to an identifier so that parsing can continue. This is an egregious hack, but it has the virtue of "just working" whether someone is using libstdc++ 4.2 or not, without the need for special flags. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80988 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX')
-rw-r--r--test/SemaCXX/libstdcxx_is_pod_hack.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaCXX/libstdcxx_is_pod_hack.cpp b/test/SemaCXX/libstdcxx_is_pod_hack.cpp
new file mode 100644
index 0000000000..df064bc6a0
--- /dev/null
+++ b/test/SemaCXX/libstdcxx_is_pod_hack.cpp
@@ -0,0 +1,7 @@
+// RUN: clang-cc -fsyntax-only %s
+
+template<typename T>
+struct __is_pod {
+};
+
+__is_pod<int> ipi;