blob: 585a242b22474e253b0f789b0271fd42caaac7e5 [file] [log] [blame]
Richard Smithf5262c62018-06-28 01:57:04 +00001// RUN: %clang_cc1 -fmodules -verify %s
2// expected-no-diagnostics
3
4#pragma clang module build M
5module M {}
6#pragma clang module contents
7#pragma clang module begin M
8struct A {
9 A();
10 ~A() { delete p; } // expected-warning {{'delete' applied to a pointer that was allocated with 'new[]'}}
11 int *p;
12};
13inline A::A() : p(new int[32]) {} // expected-note {{allocated}}
14struct B {
15 B();
16 ~B() { delete p; }
17 int *p;
18};
19#pragma clang module end
20#pragma clang module endbuild
21
22#pragma clang module import M
23B::B() : p(new int[32]) {}