diff options
author | Sean Orner <sorner@albany.edu> | 2022-11-14 18:51:23 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2022-11-14 18:51:59 (GMT) |
commit | 75ab77ee19e20f3092e88da731288a95ebf86a3a (patch) | |
tree | 8d16aa8a5e918f1b32627872007ac971d2c24898 /Utilities | |
parent | 04638e7358f1c2738d3e07b4ac51b05f691221dc (diff) | |
download | CMake-75ab77ee19e20f3092e88da731288a95ebf86a3a.zip CMake-75ab77ee19e20f3092e88da731288a95ebf86a3a.tar.gz CMake-75ab77ee19e20f3092e88da731288a95ebf86a3a.tar.bz2 |
clang-tidy module: add test for ostringstream check
Diffstat (limited to 'Utilities')
3 files changed, 17 insertions, 0 deletions
diff --git a/Utilities/ClangTidyModule/Tests/CMakeLists.txt b/Utilities/ClangTidyModule/Tests/CMakeLists.txt index 2fedfa1..5bf0e89 100644 --- a/Utilities/ClangTidyModule/Tests/CMakeLists.txt +++ b/Utilities/ClangTidyModule/Tests/CMakeLists.txt @@ -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) diff --git a/Utilities/ClangTidyModule/Tests/cmake-ostringstream-use-cmstrcat-stdout.txt b/Utilities/ClangTidyModule/Tests/cmake-ostringstream-use-cmstrcat-stdout.txt new file mode 100644 index 0000000..1b2d6e7 --- /dev/null +++ b/Utilities/ClangTidyModule/Tests/cmake-ostringstream-use-cmstrcat-stdout.txt @@ -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) + ^ diff --git a/Utilities/ClangTidyModule/Tests/cmake-ostringstream-use-cmstrcat.cxx b/Utilities/ClangTidyModule/Tests/cmake-ostringstream-use-cmstrcat.cxx new file mode 100644 index 0000000..ab749a6 --- /dev/null +++ b/Utilities/ClangTidyModule/Tests/cmake-ostringstream-use-cmstrcat.cxx @@ -0,0 +1,10 @@ +#include <sstream> + +void check() +{ + std::ostringstream test; +} + +void check2(std::ostringstream& test2) +{ +} |