Artem Dergachev | 78692ea | 2016-08-02 12:21:09 +0000 | [diff] [blame] | 1 | // 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 | |
| 5 | void nonCompoundStmt1(int& x) |
Artem Dergachev | c87d2a6 | 2016-10-03 08:11:50 +0000 | [diff] [blame^] | 6 | try { x += 1; } catch(...) { x -= 1; } // expected-warning{{Duplicate code detected}} |
Artem Dergachev | 78692ea | 2016-08-02 12:21:09 +0000 | [diff] [blame] | 7 | |
| 8 | void nonCompoundStmt2(int& x) |
Artem Dergachev | c87d2a6 | 2016-10-03 08:11:50 +0000 | [diff] [blame^] | 9 | try { x += 1; } catch(...) { x -= 1; } // expected-note{{Similar code here}} |