gribozavr2 requested changes to this revision. gribozavr2 added inline comments. This revision now requires changes to proceed.
================ Comment at: clang-tools-extra/clang-tidy/readability/RedundantStringInitCheck.cpp:21 +const char DefaultStringNames[] = "basic_string"; + ---------------- poelmanc wrote: > aaron.ballman wrote: > > I think the default should probably be `::std::basic_string` to avoid > > getting other things named `basic_string`? > The prior code had `basic_string` hard-coded at lines 27, 31, and 50 so I > initially set the default to `basic_string` just to keep the default behavior > unchanged. > > I just now tried setting it to each of `std::basic_string`, > `::std::basic_string`, and even `std::string;std::wstring` and the > `readability-redundant-string-init.cpp` tests failed with any of those > settings, so I've left it set to `basic_string`. I think we should change the checker behavior so that it checks against the fully-qualified name. We are defining a user-settable option, and changing its behavior later to allow fully-qualified names could be difficult. The reason why tests failed for you is because below the name "basic_string" is used as a method name (the name of the constructor). That checker should be rewritten to check the name of the type. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69548/new/ https://reviews.llvm.org/D69548 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits