[libcxx] r276200 - Unbreak traits tests by handling differences between version macros in clang/apple-clang.
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 20 15:53:22 PDT 2016
Author: ericwf
Date: Wed Jul 20 17:53:21 2016
New Revision: 276200
URL: http://llvm.org/viewvc/llvm-project?rev=276200&view=rev
Log:
Unbreak traits tests by handling differences between version macros in clang/apple-clang.
Modified:
libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp
libcxx/trunk/test/support/test_macros.h
Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp?rev=276200&r1=276199&r2=276200&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp Wed Jul 20 17:53:21 2016
@@ -157,7 +157,8 @@ int main()
// TODO: Remove this workaround once Clang <= 3.7 are no longer used regularly.
// In those compiler versions the __is_constructible builtin gives the wrong
// results for abominable function types.
-#if defined(__clang__) && __clang_major__ == 3 && __clang_minor__ < 8
+#if (defined(TEST_APPLE_CLANG_VER) && TEST_APPLE_CLANG_VER < 703) \
+ || (defined(TEST_CLANG_VER) && TEST_CLANG_VER < 308)
#define WORKAROUND_CLANG_BUG
#endif
#if !defined(WORKAROUND_CLANG_BUG)
Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp?rev=276200&r1=276199&r2=276200&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp Wed Jul 20 17:53:21 2016
@@ -111,7 +111,8 @@ int main()
// TODO: Remove this workaround once Clang <= 3.7 are no longer used regularly.
// In those compiler versions the __is_constructible builtin gives the wrong
// results for abominable function types.
-#if defined(__clang__) && __clang_major__ == 3 && __clang_minor__ < 8
+#if (defined(TEST_APPLE_CLANG_VER) && TEST_APPLE_CLANG_VER < 703) \
+ || (defined(TEST_CLANG_VER) && TEST_CLANG_VER < 308)
#define WORKAROUND_CLANG_BUG
#endif
#if !defined(WORKAROUND_CLANG_BUG)
Modified: libcxx/trunk/test/support/test_macros.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/test_macros.h?rev=276200&r1=276199&r2=276200&view=diff
==============================================================================
--- libcxx/trunk/test/support/test_macros.h (original)
+++ libcxx/trunk/test/support/test_macros.h Wed Jul 20 17:53:21 2016
@@ -34,6 +34,14 @@
#define TEST_HAS_BUILTIN(X) 0
#endif
+#if defined(__apple_build_version__)
+#define TEST_APPLE_CLANG_VER (__clang_major__ * 100) + __clang_minor__
+#elif defined(__clang_major__)
+#define TEST_CLANG_VER (__clang_major__ * 100) + __clang_minor__
+#elif defined(__GNUC__)
+#define TEST_GCC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
+#endif
+
/* Make a nice name for the standard version */
#ifndef TEST_STD_VER
#if __cplusplus <= 199711L
More information about the cfe-commits
mailing list