Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 932722 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/common/dout.h (-5 / +15 lines)
Lines 144-160 struct is_dynamic<dynamic_marker_t<T>> : public std::true_type {}; Link Here
144
#else
144
#else
145
#define dout_impl(cct, sub, v)						\
145
#define dout_impl(cct, sub, v)						\
146
  do {									\
146
  do {									\
147
  const bool should_gather = [&](const auto cctX) {			\
147
  const bool should_gather = [&](const auto cctX, auto sub_, auto v_) {	\
148
    if constexpr (ceph::dout::is_dynamic<decltype(sub)>::value ||	\
148
    /* The check is performed on `sub_` and `v_` to leverage the C++'s 	\
149
		  ceph::dout::is_dynamic<decltype(v)>::value) {		\
149
     * guarantee on _discarding_ one of blocks of `if constexpr`, which	\
150
     * includes also the checks for ill-formed code (`should_gather<>`	\
151
     * must not be feed with non-const expresions), BUT ONLY within	\
152
     * a template (thus the generic lambda) and under the restriction	\
153
     * it's dependant on a parameter of this template).			\
154
     * GCC prior to v14 was not enforcing these restrictions. */	\
155
    if constexpr (ceph::dout::is_dynamic<decltype(sub_)>::value ||	\
156
		  ceph::dout::is_dynamic<decltype(v_)>::value) {	\
150
      return cctX->_conf->subsys.should_gather(sub, v);			\
157
      return cctX->_conf->subsys.should_gather(sub, v);			\
151
    } else {								\
158
    } else {								\
159
      constexpr auto sub_helper = static_cast<decltype(sub_)>(sub);	\
160
      constexpr auto v_helper = static_cast<decltype(v_)>(v);		\
152
      /* The parentheses are **essential** because commas in angle	\
161
      /* The parentheses are **essential** because commas in angle	\
153
       * brackets are NOT ignored on macro expansion! A language's	\
162
       * brackets are NOT ignored on macro expansion! A language's	\
154
       * limitation, sorry. */						\
163
       * limitation, sorry. */						\
155
      return (cctX->_conf->subsys.template should_gather<sub, v>());	\
164
      return (cctX->_conf->subsys.template should_gather<sub_helper,	\
165
							 v_helper>());	\
156
    }									\
166
    }									\
157
  }(cct);								\
167
  }(cct, sub, v);								\
158
									\
168
									\
159
  if (should_gather) {							\
169
  if (should_gather) {							\
160
    ceph::logging::MutableEntry _dout_e(v, sub);                        \
170
    ceph::logging::MutableEntry _dout_e(v, sub);                        \

Return to bug 932722