25 lines · cpp
1// RUN: %clang_cc1 -fmodules -verify %s2// RUN: %clang_cc1 -fmodules -std=c++26 -verify %s3// expected-no-diagnostics4 5#pragma clang module build M6module M {}7#pragma clang module contents8#pragma clang module begin M9struct A {10 A();11 ~A() { delete p; } // expected-warning {{'delete' applied to a pointer that was allocated with 'new[]'}}12 int *p;13};14inline A::A() : p(new int[32]) {} // expected-note {{allocated}}15struct B {16 B();17 ~B() { delete p; }18 int *p;19};20#pragma clang module end21#pragma clang module endbuild22 23#pragma clang module import M24B::B() : p(new int[32]) {}25