I don't know why the compilers didn't shout here, but what _should_ have happened is: - qSwap<quint64>() gets instantiated - the unqualified swap() call inside gets resolved to std::swap() - std::swap() is not constexpr in C++17, so qSwap<quint64>() silently gets its constexpr dropped - error, due to the use of non-constexpr function qSwap() in constexpr function bswap() There's no way through the function that doesn't hit the qSwap(), so that is also not the explanation. And, indeed, replacing qSwap() with std::swap() gets me the expected error... Before compilers get the idea, rewrite the code to not require swapping. Amends 686c02224c03735356bdab987bf62644eb34cc34. Change-Id: Ie1364bb2fd148bf995a8ffd321f77a6021176928 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 2bd8e63690569711452e9c56274ffe2bf91f8f5c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%