Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / contract / test / specify / auto_pre_old_post_except_error.cpp
index 7f91bc7..c51d329 100644 (file)
@@ -6,6 +6,13 @@
 
 // Test auto error after except (for free func, but same for all contracts).
 
+#include <boost/config.hpp>
+// Not just __cplusplus to detect C++17 as MSVC defines it correctly sometimes.
+#if     (defined(__cplusplus) && __cplusplus >= 201703L) || \
+        !defined(BOOST_NO_CXX17_IF_CONSTEXPR)
+    #error "C++17 copy elision invalidates test so forcing expected failure"
+#else
+
 #include <boost/contract/function.hpp>
 
 int main() {
@@ -18,3 +25,5 @@ int main() {
     return 0;
 }
 
+#endif
+