# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
-# Copyright (c) 2014 Alexey Sokolov <sokolov@google.com>
+# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.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 4
+#serial 10
m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[
- #include <thread>
- #include <boost/shared_ptr.hpp>
- #include "pdns/ext/luawrapper/include/LuaContext.hpp"
- void test() {
- boost::shared_ptr<int> one;
- boost::shared_ptr<int> two;
- one=two;
- }
template <typename T>
struct check
{
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<typename T>
+ using member = typename T::member_type;
+
+ template<typename T>
+ void func(...) {}
+
+ template<typename T>
+ void func(member<T>*) {}
+
+ void test();
+
+ void test() {
+ func<foo>(0);
+ }
+ }
]])
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])
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])