diff options
| author | Douglas Gregor <dgregor@apple.com> | 2012-08-30 20:04:43 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2012-08-30 20:04:43 +0000 |
| commit | 8bea83a866a799b10cff49cb46ac0a3b44c6eb03 (patch) | |
| tree | 3ed31a59cec0a617e986024d632d6c5af37b5859 /clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp | |
| parent | fdf98763ace73b27a3a3a4200bef04b86a0f7b4e (diff) | |
| download | bcm5719-llvm-8bea83a866a799b10cff49cb46ac0a3b44c6eb03.tar.gz bcm5719-llvm-8bea83a866a799b10cff49cb46ac0a3b44c6eb03.zip | |
Extend the "__is_pod" hack, which demotes various type trait keywords
(__is_pod, __is_signed, etc.) to normal identifiers if they are
encountered in certain places in the grammar where we know that prior
versions of libstdc++ or libc++ use them, to still allow the use of
these keywords as type traits. Fixes <rdar://problem/9836262> and PR10184.
llvm-svn: 162937
Diffstat (limited to 'clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp')
| -rw-r--r-- | clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp b/clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp index 3ac233627cc..1ba3721c8c2 100644 --- a/clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp +++ b/clang/test/SemaCXX/libstdcxx_is_pod_hack.cpp @@ -8,6 +8,7 @@ template<typename T> struct __is_pod { + __is_pod() {} }; __is_pod<int> ipi; @@ -28,6 +29,13 @@ struct test_is_signed { bool check_signed = test_is_signed::__is_signed; -#if __has_feature(is_pod) -# error __is_pod won't work now anyway +template<bool B> struct must_be_true {}; +template<> struct must_be_true<false>; + +void foo() { + bool b = __is_pod(int); + must_be_true<__is_pod(int)> mbt; +} +#if !__has_feature(is_pod) +# error __is_pod should still be available. #endif |

