[mm-common] MM_AX_CXX_COMPILE_STDCXX: Update



commit 4007a445a252330ff44217b1338e07681cde3a7f
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Oct 27 14:45:37 2019 +0100

    MM_AX_CXX_COMPILE_STDCXX: Update
    
    Another update from upstream:
    https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html

 macros/mm-ax_cxx_compile_stdcxx.m4 | 49 ++++++++------------------------------
 1 file changed, 10 insertions(+), 39 deletions(-)
---
diff --git a/macros/mm-ax_cxx_compile_stdcxx.m4 b/macros/mm-ax_cxx_compile_stdcxx.m4
index 35cadea..ebd372f 100644
--- a/macros/mm-ax_cxx_compile_stdcxx.m4
+++ b/macros/mm-ax_cxx_compile_stdcxx.m4
@@ -1,5 +1,5 @@
 # ===========================================================================
-#  https://www.gnu.org/software/autoconf-archive/MM_AX_CXX_COMPILE_STDCXX.html
+#  https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
 # ===========================================================================
 #
 # SYNOPSIS
@@ -33,19 +33,20 @@
 #   Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov google com>
 #   Copyright (c) 2015 Paul Norman <penorman mac com>
 #   Copyright (c) 2015 Moritz Klammler <moritz klammler eu>
-#   Copyright (c) 2016 Krzesimir Nowak <qdlacz gmail com>
+#   Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz gmail com>
+#   Copyright (c) 2019 Enji Cooper <yaneurabeya gmail com>
 #
 #   Copying and distribution of this file, with or without modification, are
 #   permitted in any medium without royalty provided the copyright notice
 #   and this notice are preserved.  This file is offered as-is, without any
 #   warranty.
 
-#serial 8
-
 # Copied from ax_cxx_compile_stdcxx.m4 and added MM_ prefix to avoid
 # possible conflict with AX_CXX_COMPILE_STDCXX in other modules.
 
-dnl  This macro is based on the code from the MM_AX_CXX_COMPILE_STDCXX_11 macro
+#serial 11
+
+dnl  This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
 dnl  (serial version number 13).
 
 AC_DEFUN([MM_AX_CXX_COMPILE_STDCXX], [dnl
@@ -63,14 +64,6 @@ AC_DEFUN([MM_AX_CXX_COMPILE_STDCXX], [dnl
         [m4_fatal([invalid third argument `$3' to MM_AX_CXX_COMPILE_STDCXX])])
   AC_LANG_PUSH([C++])dnl
   ac_success=no
-  AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
-  ax_cv_cxx_compile_cxx$1,
-  [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_MM_AX_CXX_COMPILE_STDCXX_testbody_$1])],
-    [ax_cv_cxx_compile_cxx$1=yes],
-    [ax_cv_cxx_compile_cxx$1=no])])
-  if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
-    ac_success=yes
-  fi
 
   m4_if([$2], [noext], [], [dnl
   if test x$ac_success = xno; then
@@ -200,11 +193,13 @@ namespace cxx11
 
     struct Base
     {
+      virtual ~Base() {}
       virtual void f() {}
     };
 
     struct Derived : public Base
     {
+      virtual ~Derived() override {}
       virtual void f() override {}
     };
 
@@ -588,20 +583,12 @@ m4_define([_MM_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>
@@ -609,16 +596,12 @@ m4_define([_MM_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
   {
@@ -853,12 +836,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
     {
@@ -877,7 +857,6 @@ namespace cxx17
     }
 
   }
-#endif // !defined(REALLY_CLANG)
 
   namespace test_non_type_auto_template_parameters
   {
@@ -891,12 +870,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 };
 
@@ -928,14 +904,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 {};
 
@@ -953,7 +925,6 @@ namespace cxx17
     static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
 
   }
-#endif // !defined(REALLY_CLANG)
 
   namespace test_inline_variables
   {
@@ -978,6 +949,6 @@ namespace cxx17
 
 }  // namespace cxx17
 
-#endif  // __cplusplus <= 201402L
+#endif  // __cplusplus < 201703L
 
 ]])


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]