From 4d17d6213dd6704caf60997093c8db0b36af14a6 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Wed, 4 Feb 2015 22:49:18 +0000 Subject: [PATCH] Fix non-compilation with clang 3.1 --- m4/ax_cxx_compile_stdcxx_11.m4 | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4 index 163a4c64..7ad01e03 100644 --- a/m4/ax_cxx_compile_stdcxx_11.m4 +++ b/m4/ax_cxx_compile_stdcxx_11.m4 @@ -27,14 +27,14 @@ # 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 5 m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ template @@ -61,6 +61,25 @@ m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ auto d = a; auto 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() { + func(0); + } + } ]]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl