blob: d54ee176fa8868bb7bd26c2e5de27cc68b020081 [file] [log] [blame]
Raphael Isemann89ef7d92017-09-04 05:56:36 +00001// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|ui_|dbus_|.*_automoc" -verify %s
Leslie Zhai52b63052017-06-19 01:55:50 +00002
3void f1() {
4 int *p1 = new int[1];
5 int *p2 = new int[1];
6 if (p1) {
7 delete [] p1; // expected-note{{Similar code using 'p1' here}}
8 p1 = nullptr;
9 }
10 if (p2) {
11 delete [] p1; // expected-warning{{Potential copy-paste error; did you really mean to use 'p1' here?}}
12 p2 = nullptr;
13 }
14}