From: Amos Jeffries Date: Mon, 10 Nov 2014 08:42:54 +0000 (-0800) Subject: C++11: cleanup compiler flag detection logics X-Git-Tag: merge-candidate-3-v1~498 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e4dffe5ada7a5b4723646d0ca17d0079671178ea;p=thirdparty%2Fsquid.git C++11: cleanup compiler flag detection logics Annotate what GCC version is required to pass the -std=c++11 and -std=c++0x feature detection tests. Disable the tests for features we do not use that require GCC 4.5+. This should allow Squid to continue building on older OS and compilers at least until we start using those features. --- diff --git a/acinclude/ax_cxx_compile_stdcxx_11.m4 b/acinclude/ax_cxx_compile_stdcxx_11.m4 index 6be8c6a33d..715ba0b05b 100644 --- a/acinclude/ax_cxx_compile_stdcxx_11.m4 +++ b/acinclude/ax_cxx_compile_stdcxx_11.m4 @@ -44,30 +44,34 @@ #serial 4 m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ - template + template struct check { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); + static_assert(sizeof(int) <= sizeof(T), "not big enough"); // GCC 4.3+ }; +#if WHEN_SQUID_HAS_MANDATORY_GCC_4_789_SUPPORT struct Base { virtual void f() {} }; struct Child : public Base { - virtual void f() override {} + virtual void f() override {} // GCC 4.7+ }; +#endif - typedef check> right_angle_brackets; + typedef check> right_angle_brackets; // GCC 4.3+ int a; - decltype(a) b; + decltype(a) b; // GCC 4.3+ typedef check check_type; check_type c; - check_type&& cr = static_cast(c); + check_type&& cr = static_cast(c); // GCC 4.3+ - auto d = a; - auto l = [](){}; + auto d = a; // GCC 4.4+ +#if WHEN_SQUID_HAS_MANDATORY_GCC_4_789_SUPPORT + auto l = [](){}; // GCC 4.5+ (void lambda seems not to be documented) +#endif ]]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl