summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2012-05-02 18:09:59 +0000
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2012-05-02 18:09:59 +0000
commit69c199d08a8731a9d5e66004d1b434a21016c3c8 (patch)
treed91327772ef5f0f701fb33fe0afe1fae1037232c
parent361c8fbbc15e74730908e28660cb742eba046a83 (diff)
downloadgtest-69c199d08a8731a9d5e66004d1b434a21016c3c8.tar.gz
gtest-69c199d08a8731a9d5e66004d1b434a21016c3c8.tar.bz2
gtest-69c199d08a8731a9d5e66004d1b434a21016c3c8.tar.xz
Teach gtest to autodetect rtti support with clang (by Nico Weber).
git-svn-id: http://googletest.googlecode.com/svn/trunk@614 861a406c-534a-0410-8894-cb66d6ee9925
-rw-r--r--include/gtest/internal/gtest-port.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h
index 66c5096..08703e3 100644
--- a/include/gtest/internal/gtest-port.h
+++ b/include/gtest/internal/gtest-port.h
@@ -391,6 +391,13 @@
# define GTEST_HAS_RTTI 0
# endif // __GXX_RTTI
+// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
+// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
+// first version with C++ support.
+# elif defined(__clang__)
+
+# define GTEST_HAS_RTTI __has_feature(cxx_rtti)
+
// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
// both the typeid and dynamic_cast features are present.
# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)