summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/overload/new1.C
blob: 9adb4c07245b4a8a48c21e857f1a03701e89d14d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
typedef __SIZE_TYPE__ size_t;
void *operator new(size_t, unsigned int);

struct X{
  X();
  X(int);
};


void f(X *x = new X);          // { dg-error "" } 

void f(X *x = new X(4));       // { dg-error "" } 

void f(X *x = new X[4]);       // { dg-error "" } 

void f(X *x = new (3) X(6));   // { dg-error "" } 

void f(X *x = new (2) X[10]);  // { dg-error "" } 
// { dg-message "candidate" "candidate note" { target *-*-* } 18 }
// { dg-message "operator new|candidate expects" "match candidate text" { target *-*-* } 00 }

void f(X *x = new X[10][5]);   // { dg-error "" }