1 # ===========================================================================
2 # http://autoconf-archive.cryp.to/ac_cxx_compile_stdcxx_0x.html
3 # ===========================================================================
7 # AC_CXX_COMPILE_STDCXX_1Y
11 # Check for baseline language coverage in the compiler for the C++1y
20 # Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
22 # Copying and distribution of this file, with or without modification, are
23 # permitted in any medium without royalty provided the copyright notice
24 # and this notice are preserved.
26 AC_DEFUN([AC_CXX_COMPILE_STDCXX_1Y], [
27 AC_CACHE_CHECK(if g++ supports C++1y features without additional flags,
28 ac_cv_cxx_compile_cxx1y_native,
35 static_assert(sizeof(int) <= sizeof(T), "not big enough");
38 typedef check<check<bool>> right_angle_brackets;
47 typedef check<int> check_type;
49 check_type&& cr = static_cast<check_type&&>(c);],,
50 ac_cv_cxx_compile_cxx1y_native=yes, ac_cv_cxx_compile_cxx1y_native=no)
54 AC_CACHE_CHECK(if g++ supports C++1y features with -std=c++1y,
55 ac_cv_cxx_compile_cxx1y_cxx,
58 ac_save_CXXFLAGS="$CXXFLAGS"
59 CXXFLAGS="$CXXFLAGS -std=c++1y"
64 static_assert(sizeof(int) <= sizeof(T), "not big enough");
67 typedef check<check<bool>> right_angle_brackets;
76 typedef check<int> check_type;
78 check_type&& cr = static_cast<check_type&&>(c);],,
79 ac_cv_cxx_compile_cxx1y_cxx=yes, ac_cv_cxx_compile_cxx1y_cxx=no)
80 CXXFLAGS="$ac_save_CXXFLAGS"
84 AC_CACHE_CHECK(if g++ supports C++1y features with -std=gnu++1y,
85 ac_cv_cxx_compile_cxx1y_gxx,
88 ac_save_CXXFLAGS="$CXXFLAGS"
89 CXXFLAGS="$CXXFLAGS -std=gnu++1y"
94 static_assert(sizeof(int) <= sizeof(T), "not big enough");
97 typedef check<check<bool>> right_angle_brackets;
106 typedef check<int> check_type;
108 check_type&& cr = static_cast<check_type&&>(c);],,
109 ac_cv_cxx_compile_cxx1y_gxx=yes, ac_cv_cxx_compile_cxx1y_gxx=no)
110 CXXFLAGS="$ac_save_CXXFLAGS"
114 if test "$ac_cv_cxx_compile_cxx1y_native" = yes ||
115 test "$ac_cv_cxx_compile_cxx1y_cxx" = yes ||
116 test "$ac_cv_cxx_compile_cxx1y_gxx" = yes; then
117 AC_DEFINE(HAVE_STDCXX_1Y,,[Define if g++ supports C++1y features. ])
119 AC_MSG_ERROR([Could not find cxx1y support in g++])