MyDeveloperDay added inline comments.
================
Comment at:
clang-tools-extra/clang-tidy/readability/RedundantStringInitCheck.cpp:50
varDecl(hasType(hasUnqualifiedDesugaredType(recordType(
hasDeclaration(cxxRecordDecl(hasName("basic_string")))))),
hasInitializer(expr(ignoringImplicit(anyOf(
----------------
driveby aside comment (feel free to ignore): wouldn't it be good if
"basic_string" here was configurable, this would allow anyone who defines a
string class (say like StringRef) which could have this kind of redundant
string initialization be able to catch them.
Couldn't this be then used to find code like `StringRef EnabledPrefixOut = "";`
```
static void ParseMRecip(const Driver &D, const ArgList &Args,
ArgStringList &OutStrings) {
StringRef DisabledPrefixIn = "!";
StringRef DisabledPrefixOut = "!";
StringRef EnabledPrefixOut = "";
StringRef Out = "-mrecip=";
```
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69238/new/
https://reviews.llvm.org/D69238
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits