Fix ODR violation for IsFloatType_v
With recent GCC 15 trunk, I started to see: ``` ld: .../kwalletentry.cc.o:(.rodata+0x0): multiple definition of `QtPrivate::IsFloatType_v<_Float16>'; src/runtime/kwalletd/backend/CMakeFiles/KF6WalletBackend.dir/cbc.cc.o:(.rodata+0x0): first defined here ``` The issue is that constexpr is only implicitly inline for functions or static data members [0], so the constexpr IsFloatType_v specialization here causes an ODR violation. Explicitly mark the specialization as inline constexpr. [0] http://eel.is/c++draft/dcl.constexpr#1.sentence-3 Fixes: 4b755bc11a8eadd156c65b7474c11e3ce822c6f1 Pick-to: 6.7 Change-Id: Ie9257138f6d1218ca0a91f5d114aab2483cb275b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit a06f3e823bea0361125a10dd361f6fd50a4041cc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
134f23d921
commit
87b21e3ded
@ -565,7 +565,7 @@ constexpr bool IsFloatType_v = std::is_floating_point_v<T>;
|
||||
|
||||
#if QFLOAT16_IS_NATIVE
|
||||
template <>
|
||||
constexpr bool IsFloatType_v<QtPrivate::NativeFloat16Type> = true;
|
||||
inline constexpr bool IsFloatType_v<QtPrivate::NativeFloat16Type> = true;
|
||||
#endif
|
||||
|
||||
} // namespace QtPrivate
|
||||
|
Loading…
x
Reference in New Issue
Block a user