clang-tidy module: add test for ostringstream check

This commit is contained in:
Sean Orner
2022-11-14 13:51:23 -05:00
committed by Kyle Edwards
parent 04638e7358
commit 75ab77ee19
3 changed files with 17 additions and 0 deletions

View File

@@ -13,3 +13,4 @@ endfunction()
add_run_clang_tidy_test(cmake-use-cmstrlen)
add_run_clang_tidy_test(cmake-use-cmsys-fstream)
add_run_clang_tidy_test(cmake-use-bespoke-enum-class)
add_run_clang_tidy_test(cmake-ostringstream-use-cmstrcat)

View File

@@ -0,0 +1,6 @@
cmake-ostringstream-use-cmstrcat.cxx:5:3: warning: use strings and cmStrCat() instead of std::ostringstream [cmake-ostringstream-use-cmstrcat]
std::ostringstream test;
^
cmake-ostringstream-use-cmstrcat.cxx:8:13: warning: use strings and cmStrCat() instead of std::ostringstream [cmake-ostringstream-use-cmstrcat]
void check2(std::ostringstream& test2)
^

View File

@@ -0,0 +1,10 @@
#include <sstream>
void check()
{
std::ostringstream test;
}
void check2(std::ostringstream& test2)
{
}