diff options
author | Krzesimir Nowak <qdlacz@gmail.com> | 2018-04-20 17:24:03 +0200 |
---|---|---|
committer | Krzesimir Nowak <qdlacz@gmail.com> | 2018-05-05 10:14:53 +0200 |
commit | 7a0267e7ff8c2f6318a75a8700737639cdb390c5 (patch) | |
tree | ae95b055b1a5a7ba354e6ab8b41c6aabb896a166 /m4/ax_cxx_compile_stdcxx.m4 | |
parent | cab1917507e328b7044a79c0191ff4043f39f68e (diff) | |
download | autoconf-archive-7a0267e7ff8c2f6318a75a8700737639cdb390c5.tar.gz |
Some cleanups in C++17 checking code
There is a released version of clang that supports C++17, so drop all
the ifdefs that made clang to skip some checks.
Also, a __cplusplus macro is specified to expand to 201703L, so fix
the check accordingly.
Diffstat (limited to 'm4/ax_cxx_compile_stdcxx.m4')
-rw-r--r-- | m4/ax_cxx_compile_stdcxx.m4 | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4 index 0b6cb3a..9e9eaed 100644 --- a/m4/ax_cxx_compile_stdcxx.m4 +++ b/m4/ax_cxx_compile_stdcxx.m4 @@ -40,7 +40,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 9 +#serial 10 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). @@ -577,20 +577,12 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ #error "This is not a C++ compiler" -#elif __cplusplus <= 201402L +#elif __cplusplus < 201703L #error "This is not a C++17 compiler" #else -#if defined(__clang__) - #define REALLY_CLANG -#else - #if defined(__GNUC__) - #define REALLY_GCC - #endif -#endif - #include <initializer_list> #include <utility> #include <type_traits> @@ -598,16 +590,12 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ namespace cxx17 { -#if !defined(REALLY_CLANG) namespace test_constexpr_lambdas { - // TODO: test it with clang++ from git - constexpr int foo = [](){return 42;}(); } -#endif // !defined(REALLY_CLANG) namespace test::nested_namespace::definitions { @@ -842,12 +830,9 @@ namespace cxx17 } -#if !defined(REALLY_CLANG) namespace test_template_argument_deduction_for_class_templates { - // TODO: test it with clang++ from git - template <typename T1, typename T2> struct pair { @@ -866,7 +851,6 @@ namespace cxx17 } } -#endif // !defined(REALLY_CLANG) namespace test_non_type_auto_template_parameters { @@ -880,12 +864,9 @@ namespace cxx17 } -#if !defined(REALLY_CLANG) namespace test_structured_bindings { - // TODO: test it with clang++ from git - int arr[2] = { 1, 2 }; std::pair<int, int> pr = { 1, 2 }; @@ -917,14 +898,10 @@ namespace cxx17 const auto [ x3, y3 ] = f3(); } -#endif // !defined(REALLY_CLANG) -#if !defined(REALLY_CLANG) namespace test_exception_spec_type_system { - // TODO: test it with clang++ from git - struct Good {}; struct Bad {}; @@ -942,7 +919,6 @@ namespace cxx17 static_assert (std::is_same_v<Good, decltype(f(g1, g2))>); } -#endif // !defined(REALLY_CLANG) namespace test_inline_variables { @@ -967,6 +943,6 @@ namespace cxx17 } // namespace cxx17 -#endif // __cplusplus <= 201402L +#endif // __cplusplus < 201703L ]]) |