summaryrefslogtreecommitdiff
path: root/clang/test/CXX/expr/expr.unary/expr.new/p17.cpp
blob: 0d108eb6a894dc9417133c1627764d09be9c7213 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// 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{{calling a private destructor of class 'dtor'}}
  new dtor[3]; // expected-error{{calling a private destructor of class 'dtor'}}
  new dtor[3][3]; // expected-error{{calling a private destructor of class 'dtor'}}
}