aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorkosak <kosak@google.com>2015-01-08 03:34:16 +0000
committerkosak <kosak@google.com>2015-01-08 03:34:16 +0000
commit7489581db8ea450d22f64e9a7a824e275fa605a0 (patch)
tree64f53c5894faf23416dbc186bdef71035934bfb5 /include
parent12ab6bb16fe055087dd64bb41f20a74dd356a5f0 (diff)
downloadgoogletest-7489581db8ea450d22f64e9a7a824e275fa605a0.tar.gz
googletest-7489581db8ea450d22f64e9a7a824e275fa605a0.tar.bz2
googletest-7489581db8ea450d22f64e9a7a824e275fa605a0.zip
Fix build of Objective-C++ files with new clang versions.
Diffstat (limited to 'include')
-rw-r--r--include/gtest/internal/gtest-port.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h
index d8f22c25..208dcfb4 100644
--- a/include/gtest/internal/gtest-port.h
+++ b/include/gtest/internal/gtest-port.h
@@ -498,6 +498,11 @@ struct _RTL_CRITICAL_SECTION;
# define _HAS_EXCEPTIONS 1
# endif // _HAS_EXCEPTIONS
# define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
+# elif defined(__clang__)
+// __EXCEPTIONS determines if cleanups are enabled. In Obj-C++ files, there can
+// be cleanups for ObjC exceptions, but C++ exceptions might still be disabled.
+// So use a __has_feature check for C++ exceptions instead.
+# define GTEST_HAS_EXCEPTIONS __has_feature(cxx_exceptions)
# elif defined(__GNUC__) && __EXCEPTIONS
// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
# define GTEST_HAS_EXCEPTIONS 1