EugeneZelenko wrote: > refactored and integrated into existing checker. seems to work, with my local > test.cpp files. however i am struggling, adding tests. > > https://github.com/llvm/llvm-project/pull/116033/files#diff-da808871a68f05cbe09bd3761e5092a51a46608bd2206db26c2a98f93e75f68cR274 > > .substr() is undefined. > > ``` > error: no member named 'substr' in 'std::basic_string<char>' > [clang-diagnostic-error] > 268 | s.substr(0, 5) == "hello"; > ``` > > any advice? or sample where i can take a look how to get a real std::string > or how to mock it?
Tests use mock-up header (`clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/string`), so you need to add `substr` there. https://github.com/llvm/llvm-project/pull/116033 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits