mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-21 13:49:46 +08:00
PR c++/8316, c++/9315, c++/10136
PR c++/8316, c++/9315, c++/10136 * call.c (print_z_candidate): Split out from... (print_z_candidiates): ...here. (joust): Use it. From-SVN: r64650
This commit is contained in:
parent
b10af5a419
commit
c77e059777
21
gcc/testsuite/g++.dg/overload/new1.C
Normal file
21
gcc/testsuite/g++.dg/overload/new1.C
Normal file
@ -0,0 +1,21 @@
|
||||
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-error "candidate" "" { target *-*-* } 00 }
|
||||
|
||||
void f(X *x = new X[10][5]); // { dg-error "" }
|
@ -11,8 +11,8 @@ struct X
|
||||
{
|
||||
X (int);
|
||||
};
|
||||
void Foo (int, float, bool);
|
||||
void Foo (float, int, X);
|
||||
void Foo (int, float, bool); // WARNING - candidate
|
||||
void Foo (float, int, X); // WARNING - candidate
|
||||
|
||||
void Baz ()
|
||||
{
|
||||
|
@ -1,21 +0,0 @@
|
||||
//Build don't link:
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
void *operator new(size_t, unsigned int);
|
||||
|
||||
struct X{
|
||||
X();
|
||||
X(int);
|
||||
};
|
||||
|
||||
|
||||
void f(X *x = new X); // ERROR -
|
||||
|
||||
void f(X *x = new X(4)); // ERROR -
|
||||
|
||||
void f(X *x = new X[4]); // ERROR -
|
||||
|
||||
void f(X *x = new (3) X(6)); // ERROR -
|
||||
|
||||
void f(X *x = new (2) X[10]); // ERROR -
|
||||
|
||||
void f(X *x = new X[10][5]); // ERROR -
|
Loading…
Reference in New Issue
Block a user