build: strengthen the C++ standard flag test

On the CI, we have this spurious failure with clang 3.9 with
-std=c++17:

    In file included from list.y:23:
    In file included from /usr/include/c++/4.8/iostream:39:
    In file included from /usr/include/c++/4.8/ostream:38:
    In file included from /usr/include/c++/4.8/ios:42:
    In file included from /usr/include/c++/4.8/bits/ios_base.h:41:
    In file included from /usr/include/c++/4.8/bits/locale_classes.h:40:
    In file included from /usr/include/c++/4.8/string:52:
    In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:
    In file included from /usr/include/c++/4.8/ext/string_conversions.h:43:
    /usr/include/c++/4.8/cstdio:120:11: error: no member named 'gets' in the global namespace
      using ::gets;
            ~~^

This shows that our test, based on gl_WARN_ADD, is a joke.  We have to
really check for at least a bit of C++.

* m4/ax_check_compile_flag.m4, m4/bison-cxx-std.m4: New.
* configure.ac: Use them to make sure the compiler actually works.
This commit is contained in:
Akim Demaille
2018-09-16 18:20:56 +02:00
parent 8da0cef821
commit 3367d8dd5c
5 changed files with 262 additions and 16 deletions

View File

@@ -57,8 +57,11 @@ fi
# Requiring a specific C++ standard.
: ${CXX98_CXXFLAGS='@CXX98_CXXFLAGS@'}
: ${CXX03_CXXFLAGS='@CXX03_CXXFLAGS@'}
: ${CXX11_CXXFLAGS='@CXX11_CXXFLAGS@'}
: ${STDCXX_FLAGS='@STDCXX_FLAGS@'}
: ${CXX14_CXXFLAGS='@CXX14_CXXFLAGS@'}
: ${CXX17_CXXFLAGS='@CXX17_CXXFLAGS@'}
: ${CXX2A_CXXFLAGS='@CXX2A_CXXFLAGS@'}
# Be sure that the C++ compiler is not broken because of gnulib. This
# cannot be checked in configure (gnulib is not parameterized yet),