From: Alex Rousskov Date: Sat, 23 Nov 2019 09:18:24 +0000 (+0000) Subject: Bug 5009: Build failure with older clang libc++ (#514) X-Git-Tag: SQUID_5_0_1~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=84011c4813ca9949f949ecd90524fc468b5c1683;p=thirdparty%2Fsquid.git Bug 5009: Build failure with older clang libc++ (#514) Older clang libc++ implementations correctly reject implicit usage of an explicit (in C++11) std::map copy constructor with "chosen constructor is explicit in copy-initialization" errors. The same code becomes legal in C++14[1], so newer libc++ implementation allow implicit usage (even in C++11), but there is no need for copy-initialization here at all. Evidently, libstdc++ has never declared constructors explicit. The bug was seen with Apple clang in Xcode 5.1.1 (roughly upstream clang 3.4) and Xcode 6.2 (roughly upstream clang 3.5), both using libc++. [1] http://cplusplus.github.io/LWG/lwg-defects.html#2193 --- diff --git a/src/acl/Options.cc b/src/acl/Options.cc index 5b9bb1d5a1..b6be3314bc 100644 --- a/src/acl/Options.cc +++ b/src/acl/Options.cc @@ -246,14 +246,14 @@ Acl::ParseFlags(const Options &options, const ParameterFlags &flags) const Acl::Options & Acl::NoOptions() { - static const Options none = {}; + static const Options none; return none; } const Acl::ParameterFlags & Acl::NoFlags() { - static const ParameterFlags none = {}; + static const ParameterFlags none; return none; }