brintos

brintos / llvm-project-archived public Read only

0
0
Text · 462 B · d0fbc50 Raw
10 lines · cpp
1// RUN: %clang_analyze_cc1 -fcxx-exceptions -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s2 3// Tests if function try blocks are correctly handled.4 5void nonCompoundStmt1(int& x)6  try { x += 1; } catch(...) { x -= 1; } // expected-warning{{Duplicate code detected}}7 8void nonCompoundStmt2(int& x)9  try { x += 1; } catch(...) { x -= 1; } // expected-note{{Similar code here}}10