From a6c5dbbeb2ec3c09b026ddb98e658ff2fff49db7 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Thu, 30 Apr 2015 09:36:56 +0200 Subject: [PATCH] Import the latest C++ 2011 detection macro --- m4/ax_cxx_compile_stdcxx_11.m4 | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4 index a10a1b32b7..a9a8f584fd 100644 --- a/m4/ax_cxx_compile_stdcxx_11.m4 +++ b/m4/ax_cxx_compile_stdcxx_11.m4 @@ -27,18 +27,16 @@ # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner -# Copyright (c) 2014 Alexey Sokolov +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # # 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 4 +#serial 10 m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ - #include - #include "pdns/ext/luawrapper/include/LuaContext.hpp" template struct check { @@ -63,6 +61,29 @@ m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ auto d = a; auto l = [](){}; + // Prevent Clang error: unused variable 'l' [-Werror,-Wunused-variable] + struct use_l { use_l() { l(); } }; + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function because of this + namespace test_template_alias_sfinae { + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { + func(0); + } + } ]]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl @@ -92,7 +113,7 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, $cachevar, [ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$LUA_CFLAGS $CXXFLAGS $switch" + CXXFLAGS="$CXXFLAGS $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [eval $cachevar=yes], [eval $cachevar=no]) @@ -112,7 +133,7 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, $cachevar, [ac_save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $LUA_CFLAGS $switch" + CXXFLAGS="$CXXFLAGS $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], [eval $cachevar=yes], [eval $cachevar=no]) -- 2.47.2