This fixes a crash where we would neglect to mark a destructor referenced for an __attribute__((no_destory)) array. The destructor is needed though, since if an exception is thrown we need to cleanup the elements. rdar://48462498 Differential revision: https://reviews.llvm.org/D61165 llvm-svn: 360446
17 lines
562 B
C++
17 lines
562 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
class ctor {
|
|
ctor(); // expected-note{{implicitly declared private here}}
|
|
};
|
|
|
|
class dtor {
|
|
~dtor(); // expected-note 3 {{implicitly declared private here}}
|
|
};
|
|
|
|
void test() {
|
|
new ctor[0]; // expected-error{{calling a private constructor of class 'ctor'}}
|
|
new dtor[0]; // expected-error{{temporary of type 'dtor' has private destructor}}
|
|
new dtor[3]; // expected-error{{temporary of type 'dtor' has private destructor}}
|
|
new dtor[3][3]; // expected-error{{temporary of type 'dtor' has private destructor}}
|
|
}
|