[PATCH] D24916: [analyzer] Extend bug reports with extra notes - CloneChecker
Anna Zaks via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 28 10:55:08 PDT 2016
zaks.anna added inline comments.
================
Comment at: test/Analysis/copypaste/macros.cpp:8
@@ -7,3 +7,3 @@
-int foo(int a) { // expected-warning{{Detected code clone.}}
+int foo(int a) { // expected-warning{{Clones of this code were detected}}
a = a + 1;
----------------
- Duplicate code detected
- Similar code here
================
Comment at: test/Analysis/copypaste/suspicious-clones.cpp:61
@@ -60,3 +60,3 @@
b /= a + b;
- c -= b * a; // expected-warning{{suspicious code clone detected; did you mean to use 'a'?}}
+ c -= b * a; // expected-warning{{Suspicious code clone detected; did you mean to use 'a'?}}
return c;
----------------
zaks.anna wrote:
> zaks.anna wrote:
> > The error message seems too verbose and focused on the implementation rather than user (ex: "suspicious code clone" and "suggestion is based").
> >
> > Maybe we could say something like this:
> >
> > - Did you mean to use 'a'?
> > - Similar code snippet here
> >
> >
> Better:
>
> Did you mean to use 'a'?
> Similar code snippet here uses 'b'
>
> Did you mean to use 'a' instead of 'b'?
> Similar code snippet here
Another refinement
Potential copy-paste error: did you mean to use 'a' instead of 'b'?
Similar code here
https://reviews.llvm.org/D24916
More information about the cfe-commits
mailing list