summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/crash3.C
blob: 24a3360ba33e4be8737336f41fa2c56a565e5b31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// { dg-do compile }
// Contributed by Wolfgang Wieser <wwieser at gmx dot de>
// PR c++/15967: ICE with ambiguous operator new

typedef __SIZE_TYPE__ size_t; 

struct A { void *operator new(size_t s){} };  // { dg-error "operator new" }
struct B { void *operator new(size_t s){} };  // { dg-error "operator new" }

struct C : A,B {}; 

int crash() 
{
  C *c=new C();   // { dg-error "ambiguous" }
}