]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
C++11: cleanup compiler flag detection logics
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 10 Nov 2014 08:42:54 +0000 (00:42 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 10 Nov 2014 08:42:54 +0000 (00:42 -0800)
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.

acinclude/ax_cxx_compile_stdcxx_11.m4

index 6be8c6a33dd2b847250d126f6c77f758e09d2ded..715ba0b05b821bf2f23c3d442919dec22b4d1a22 100644 (file)
 #serial 4
 
 m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[
-  template <typename T>
+    template <typename T>
     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<check<bool>> right_angle_brackets;
+    typedef check<check<bool>> right_angle_brackets; // GCC 4.3+
 
     int a;
-    decltype(a) b;
+    decltype(a) b; // GCC 4.3+
 
     typedef check<int> check_type;
     check_type c;
-    check_type&& cr = static_cast<check_type&&>(c);
+    check_type&& cr = static_cast<check_type&&>(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