Skip to content

Commit

Permalink
Merge pull request #71426 from BrettDong/lit-libc++
Browse files Browse the repository at this point in the history
Make clang-tidy plugin test suite compatible with libc++
  • Loading branch information
Maleclypse authored Feb 4, 2024
2 parents 0e94991 + 7057d6e commit ea5f68c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/clang-tidy-plugin/test/assert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <assert.h>
#include <stdlib.h>

#include <cstdlib>
#include <cata_assert.h>

void f0()
Expand Down
4 changes: 2 additions & 2 deletions tools/clang-tidy-plugin/test/determinism.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ int rand();
void f()
{
std::mt19937 gen0;
// CHECK-MESSAGES: [[@LINE-1]]:18: warning: Construction of library random engine 'std::mt19937' (aka 'mersenne_twister_engine<unsigned {{(int|long)}}, 32, 624, 397, 31, 2567483615UL, 11, 4294967295UL, 7, 2636928640UL, 15, 4022730752UL, 18, 1812433253UL>'). To ensure determinism for a fixed seed, use the common tools from rng.h rather than your own random number engines. [cata-determinism]
// CHECK-MESSAGES: [[@LINE-1]]:18: warning: Construction of library random engine 'std::mt19937' (aka 'mersenne_twister_engine<unsigned {{(int|long)}}, 32, 624, 397, 31, 2567483615{{(U|UL)}}, 11, 4294967295{{(U|UL)}}, 7, 2636928640{{(U|UL)}}, 15, 4022730752{{(U|UL)}}, 18, 1812433253{{(UL)?}}>'). To ensure determinism for a fixed seed, use the common tools from rng.h rather than your own random number engines. [cata-determinism]
cata_default_random_engine gen1( 0 );
// CHECK-MESSAGES: [[@LINE-1]]:32: warning: Construction of library random engine 'cata_default_random_engine' (aka 'linear_congruential_engine<unsigned {{(int|long)}}, 16807UL, 0UL, 2147483647UL>'). To ensure determinism for a fixed seed, use the common tools from rng.h rather than your own random number engines. [cata-determinism]
// CHECK-MESSAGES: [[@LINE-1]]:32: warning: Construction of library random engine 'cata_default_random_engine' (aka 'linear_congruential_engine<unsigned {{(int|long)}}, 16807{{(UL)?}}, 0{{(UL)?}}, 2147483647{{(UL)?}}>'). To ensure determinism for a fixed seed, use the common tools from rng.h rather than your own random number engines. [cata-determinism]
SomeOtherStruct s0;
StructWithSeedButNotResultType s1;
SomeOtherAlias a;
Expand Down
2 changes: 1 addition & 1 deletion tools/clang-tidy-plugin/test/use-localized-sorting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void sort1( NonString *start, NonString *end )
void sortit0( std::vector<std::string>::iterator start, std::vector<std::string>::iterator end )
{
std::sort( start, end );
// CHECK-MESSAGES: warning: Raw sort of 'typename __traits_type::value_type' (aka 'std::basic_string<char>'). For UI purposes please use localized_compare from translations.h. [cata-use-localized-sorting]
// CHECK-MESSAGES: warning: Raw sort of 'typename {{.*}}' (aka 'std::{{.*string.*}}'). For UI purposes please use localized_compare from translations.h. [cata-use-localized-sorting]
}

void sortit1( std::vector<NonString>::iterator start, std::vector<NonString>::iterator end )
Expand Down

0 comments on commit ea5f68c

Please sign in to comment.