blob: 7a69097579abb8cfea131ca0eaa1bb5e945879cb [file] [log] [blame]
Artem Dergachev78692ea2016-08-02 12:21:09 +00001// RUN: %clang_cc1 -analyze -fcxx-exceptions -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s
2
3// Tests if function try blocks are correctly handled.
4
5void nonCompoundStmt1(int& x)
Artem Dergachevc87d2a62016-10-03 08:11:50 +00006 try { x += 1; } catch(...) { x -= 1; } // expected-warning{{Duplicate code detected}}
Artem Dergachev78692ea2016-08-02 12:21:09 +00007
8void nonCompoundStmt2(int& x)
Artem Dergachevc87d2a62016-10-03 08:11:50 +00009 try { x += 1; } catch(...) { x -= 1; } // expected-note{{Similar code here}}