poelmanc marked 3 inline comments as done.
poelmanc 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(
----------------
MyDeveloperDay wrote:
> 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=";
> ```
> 
Great suggestion, done. See https://reviews.llvm.org/D69548. (I figured it 
should be a separate topic from this one, but holler if you prefer I add it to 
this patch.)


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D69238



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to