- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
// We have to put a separate function with 'if constexpr' here as Visual Studio
// produces a false positive warning in a case of RegDstUInt == uint32
// (shifting uint32 left by 32 is an undefined behavior)
// See: https://developercommunity.visualstudio.com/content/problem/225040/c4293-false-positive-on-unreacheable-code.html
static RegDstUInt get_hi_part( RegDstUInt value)
{
// Clang-Tidy generates a false positive 'misc-suspicious-semicolon' warning
// on `if constexpr ()` with template
// LLVM bug 35824: https://bugs.llvm.org/show_bug.cgi?id=35824
if constexpr( (sizeof(RegDstUInt) > 4)
return value >> 32; // NOLINT
// GCC bug 81676 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81676
// Wrong warning with unused-but-set-parameter within 'if constexpr'
(void)(value);
return 0;
}
В попытке починить сборку в Visual Studio поломали GCC и Clang-Tidy.