summaryrefslogtreecommitdiff
path: root/test/SemaCXX/delete-mismatch.h
blob: 84fcd611b60d60f91f4c421eff51db538c41c5b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Header for PCH test delete.cpp
namespace pch_test {
struct X {
  int *a;
  X();
  X(int);
  X(bool)
    : a(new int[1]) { } // expected-note{{allocated with 'new[]' here}}
  ~X()
  {
    delete a; // expected-warning{{'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'?}}
    // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:9}:"[]"
  }
};
}