[PATCH] D69548: Give clang-tidy readability-redundant-string-init a customizable list of string types to fix

Conrad Poelman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 29 16:16:05 PDT 2019


poelmanc marked an inline comment as done.
poelmanc added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/RedundantStringInitCheck.cpp:21
 
+const char DefaultStringNames[] = "basic_string";
+
----------------
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`.


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69548/new/

https://reviews.llvm.org/D69548





More information about the cfe-commits mailing list