@@ -3299,11 +3299,44 @@ static void preprocess_files()
32993299 }
33003300}
33013301
3302- static void safe_api ()
3302+ static void tokenlist_api ()
33033303{
3304+ std::vector<std::string> filenames;
3305+ {
3306+ char input[] = " code" ; // NOLINT(misc-const-correctness)
3307+ simplecpp::TokenList ({input,sizeof (input)},filenames," " );
3308+ }
3309+ {
3310+ const char input[] = " code" ;
3311+ simplecpp::TokenList ({input,sizeof (input)},filenames," " );
3312+ }
3313+ {
3314+ char input[] = " code" ; // NOLINT(misc-const-correctness)
3315+ simplecpp::TokenList (input,filenames," " );
3316+ }
3317+ {
3318+ const char input[] = " code" ;
3319+ simplecpp::TokenList (input,filenames," " );
3320+ }
3321+ {
3322+ unsigned char input[] = " code" ; // NOLINT(misc-const-correctness)
3323+ simplecpp::TokenList (input,filenames," " );
3324+ }
3325+ {
3326+ const unsigned char input[] = " code" ;
3327+ simplecpp::TokenList (input,filenames," " );
3328+ }
3329+ {
3330+ std::string input = " code" ; // NOLINT(misc-const-correctness)
3331+ simplecpp::TokenList (input,filenames," " );
3332+ }
3333+ {
3334+ const std::string input = " code" ;
3335+ simplecpp::TokenList (input,filenames," " );
3336+ }
3337+
33043338 // this test is to make sure the safe APIs are compiling
33053339#if defined(__cpp_lib_string_view) || defined(__cpp_lib_span)
3306- std::vector<std::string> filenames;
33073340# if defined(__cpp_lib_string_view)
33083341 {
33093342 const char input[] = " code" ;
@@ -3660,7 +3693,7 @@ int main(int argc, char **argv)
36603693
36613694 TEST_CASE (preprocess_files);
36623695
3663- TEST_CASE (safe_api );
3696+ TEST_CASE (tokenlist_api );
36643697
36653698 TEST_CASE (isAbsolutePath);
36663699
0 commit comments