summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/copypaste/function-try-block.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2016-10-03 08:11:50 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2016-10-03 08:11:50 +0000
commitc87d2a613ec0e99e43ea683743736c8acc9bd47c (patch)
tree8d9024e4bc23322982245a97d4e48521b75825bc /clang/test/Analysis/copypaste/function-try-block.cpp
parent918602df8dc137dfeb148315248751b68776c25d (diff)
downloadbcm5719-llvm-c87d2a613ec0e99e43ea683743736c8acc9bd47c.tar.gz
bcm5719-llvm-c87d2a613ec0e99e43ea683743736c8acc9bd47c.zip
[analyzer] Improve CloneChecker diagnostics
Highlight code clones referenced by the warning message with the help of the extra notes feature recently introduced in r283092. Change warning text to more clang-ish. Remove suggestions from the copy-paste error checker diagnostics, because currently our suggestions are strictly 50% wrong (we do not know which of the two code clones contains the error), and for that reason we should not sound as if we're actually suggesting this. Hopefully a better solution would bring them back. Make sure the suspicious clone pair structure always mentions the correct variable for the second clone. Differential Revision: https://reviews.llvm.org/D24916 llvm-svn: 283094
Diffstat (limited to 'clang/test/Analysis/copypaste/function-try-block.cpp')
-rw-r--r--clang/test/Analysis/copypaste/function-try-block.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/Analysis/copypaste/function-try-block.cpp b/clang/test/Analysis/copypaste/function-try-block.cpp
index b13096d949a..7a69097579a 100644
--- a/clang/test/Analysis/copypaste/function-try-block.cpp
+++ b/clang/test/Analysis/copypaste/function-try-block.cpp
@@ -3,7 +3,7 @@
// Tests if function try blocks are correctly handled.
void nonCompoundStmt1(int& x)
- try { x += 1; } catch(...) { x -= 1; } // expected-warning{{Detected code clone.}}
+ try { x += 1; } catch(...) { x -= 1; } // expected-warning{{Duplicate code detected}}
void nonCompoundStmt2(int& x)
- try { x += 1; } catch(...) { x -= 1; } // expected-note{{Related code clone is here.}}
+ try { x += 1; } catch(...) { x -= 1; } // expected-note{{Similar code here}}
OpenPOWER on IntegriCloud