Skip to content

Commit 5e28623

Browse files
jcfrgummif
andcommitted
Fix error: default initialization of an object of const type
This commit fixes a regression introduced in a3e5b54 (Problem: Socket options lack type-safety (#393)). It addresses the following error reported when building the project on macOS 10.11.6. Errors like the following: cppzmq/zmq.hpp:1325:39: error: default initialization of an object of const type 'const affinity_t' (aka 'const integral_option<4, unsigned long long, false>') without a user-provided default constructor Compiler version: Apple LLVM version 8.0.0 (clang-800.0.42.1) Target: x86_64-apple-darwin15.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin Similar issues: * tensorflow/tensorflow#28839 error: default initialization of an object of const type 'const Subgraph::Identity' without a user-provided default constructor * https://bugzilla.mozilla.org/show_bug.cgi?id=1451088 Clang 3.8: error: default initialization of an object of const type 'const js::jit::ArithPolicy' without a user-provided default constructor * googleapis/google-cloud-cpp#1593 [osx] error: default initialization of an object of const type Co-authored-by: Gudmundur Adalsteinsson <[email protected]>
1 parent 3746e5c commit 5e28623

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

zmq.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,19 +1296,19 @@ template<int Opt, int NullTerm = 1> struct array_option
12961296

12971297
#define ZMQ_DEFINE_INTEGRAL_OPT(OPT, NAME, TYPE) \
12981298
using NAME##_t = integral_option<OPT, TYPE, false>; \
1299-
ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME
1299+
ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME{}
13001300
#define ZMQ_DEFINE_INTEGRAL_BOOL_UNIT_OPT(OPT, NAME, TYPE) \
13011301
using NAME##_t = integral_option<OPT, TYPE, true>; \
1302-
ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME
1302+
ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME{}
13031303
#define ZMQ_DEFINE_ARRAY_OPT(OPT, NAME) \
13041304
using NAME##_t = array_option<OPT>; \
1305-
ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME
1305+
ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME{}
13061306
#define ZMQ_DEFINE_ARRAY_OPT_BINARY(OPT, NAME) \
13071307
using NAME##_t = array_option<OPT, 0>; \
1308-
ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME
1308+
ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME{}
13091309
#define ZMQ_DEFINE_ARRAY_OPT_BIN_OR_Z85(OPT, NAME) \
13101310
using NAME##_t = array_option<OPT, 2>; \
1311-
ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME
1311+
ZMQ_INLINE_VAR ZMQ_CONSTEXPR_VAR NAME##_t NAME{}
13121312

13131313
// duplicate definition from libzmq 4.3.3
13141314
#if defined _WIN32

0 commit comments

Comments
 (0)