summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-08 18:16:15 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-08 18:16:15 +0000
commit01e09d9d91ac65d85cb0f4ccbcd42204cf343410 (patch)
tree543dcdd321978f226e6562934a30127f57163e1e /clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
parentcb45bd9cb33932e79cceaca3ba560182ba329f72 (diff)
downloadbcm5719-llvm-01e09d9d91ac65d85cb0f4ccbcd42204cf343410.tar.gz
bcm5719-llvm-01e09d9d91ac65d85cb0f4ccbcd42204cf343410.zip
Introduce an egregious hack to work around a bug in libstdc++ 4.2.x's
<tr1/hashtable> header, where a friend class template std::tr1::__detail::_Map_base is declared with the wrong template parameters. GCC doesn't catch the problem, so Clang does a little back-flip to avoid diagnosing just this one instance of the problem. llvm-svn: 100790
Diffstat (limited to 'clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp')
-rw-r--r--clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp b/clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
index 7a4bebca864..2e920321953 100644
--- a/clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
+++ b/clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp
@@ -1,5 +1,11 @@
// RUN: %clang_cc1 -fsyntax-only %s
+// This is a test for an egregious hack in Clang that works around
+// issues with GCC's evolution. libstdc++ 4.2.x uses __is_pod as an
+// identifier (to declare a struct template like the one below), while
+// GCC 4.3 and newer make __is_pod a keyword. Clang treats __is_pod as
+// a keyword *unless* it is introduced following the struct keyword.
+
template<typename T>
struct __is_pod {
};
OpenPOWER on IntegriCloud