[clang-tidy] Make test work on architectures which do not provide a __int128_t

See f10cee91ae. The test did still not run successful since the
`CHECK-MESSAGE` line is still read and considered even though the `#ifdef` removes the code if
`__int128_t` is not available. Now there is a fallback type in this case.
This commit is contained in:
Danny Mösch 2022-03-30 08:03:32 +02:00
parent 115b3ace36
commit b3079e8a7e

View File

@ -288,10 +288,12 @@ int Test6() {
#ifdef __SIZEOF_INT128__
template <__int128_t N>
#else
template <long N> // Fallback for platforms which do not define `__int128_t`
#endif
bool Baz() { return sizeof(A) < N; }
// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: suspicious comparison of 'sizeof(expr)' to a constant
bool Test7() { return Baz<-1>(); }
#endif
int ValidExpressions() {
int A[] = {1, 2, 3, 4};