summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/crash3.C
blob: 5b58e8ed5596bb2c9b803b64cd939d93a7f266a7 (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-message "operator new" }
struct B { void *operator new(size_t s){} };  // { dg-message "operator new" }

struct C : A,B {}; 

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