]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: svc.bucket: assign to optional<> using "=" 32433/head
authorKefu Chai <kchai@redhat.com>
Fri, 27 Dec 2019 03:38:06 +0000 (11:38 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 27 Dec 2019 03:38:08 +0000 (11:38 +0800)
commit71cb0fdc64c5a1af25d618502ce2e67e3d80a7dd
tree8065246b0da9c21a67440b504abf8aef0cd11280
parentc1da1259741f66211d877af423af712f51c1481a
rgw: svc.bucket: assign to optional<> using "="

instead of using

*optional_val = value;

we should use:

optional_val = value;

otherwise we will have following runtime assertion failure like

/usr/include/c++/8/optional:945: constexpr _Tp& std::_Optional_base<_Tp, true, true>::_M_get() [with _Tp = RGWBucketInfo*]: Assertion 'this->_M_is_engaged()' failed.

when compiled with the `_GLIBCXX_ASSERTIONS` macro defined. and recent
`redhat-rpm-config` adds `-D_GLIBCXX_ASSERTIONS` to
`__global_compiler_flags`, which is in turn included by `optflags`. and
`optflags` is pratically used everywhere.

Fixes: https://tracker.ceph.com/issues/43414
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/rgw/services/svc_bucket_sobj.cc