From c87d2a613ec0e99e43ea683743736c8acc9bd47c Mon Sep 17 00:00:00 2001 From: Artem Dergachev Date: Mon, 3 Oct 2016 08:11:50 +0000 Subject: [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 --- clang/test/Analysis/copypaste/function-try-block.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/test/Analysis/copypaste/function-try-block.cpp') 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}} -- cgit v1.2.3