ccotter added inline comments.

================
Comment at: 
clang-tools-extra/test/clang-tidy/checkers/bugprone/string-constructor.cpp:58
+  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: string constructor arguments 
might be incorrect;
+  std::string s7(kText[1], 10);
+  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: string constructor arguments 
might be incorrect;
----------------
This is specifically a bug I wrote recently where I meant to write `&kText[1]`. 
This doesn't fall under the "arguments swapped" case since indeed I merely 
forgot a '&'. At most, the tool can flag this potentially buggy code and 
suggest casts if the author determines the code is correct as is. However, the 
tool does not actually provide replacements as such code is more likely to be 
incorrect and require the author to determine the fix and apply it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143971

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

Reply via email to