rgw_file.h: Clang has a more rigid requirement for definition.
The ODR-used in [1] indicates that ODR-used does not result in the
definition of the variable...
The definition is:
class class RGWFileHandle {
static constexpr uint32_t FLAG_NONE = 0x0000;
}
And in this case, quoted from: Chefu Chai:
because the constructor of std::tuple<> always passes its
parameters by reference if possible and the values of its
parameters are evaluated, RGWFileHandle::FLAG_NONE is ODR-used[1].
but RGWFileHandle::FLAG_NONE out side of the class is not found
anywhere. this fails the linker. so we should convert this lvalue
to rvalue manually: uint32_t(RGWFileHandle::FLAG_NONE) when
passing it to the ctor.
So the transformation to a rvalue allow of const evaluation, and thus
a definition of the varaible is no longer needed.
Otherwise without the cast this will result, during linking, in:
./.libs/librgw.so: undefined reference to `rgw::RGWFileHandle::FLAG_NONE'
clang++: error: linker command failed with exit code 1