xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/new-with-default-arg.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm -o - %s
2*f4a2713aSLionel Sambuc // pr5547
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc struct A {
5*f4a2713aSLionel Sambuc   void* operator new(__typeof(sizeof(int)));
6*f4a2713aSLionel Sambuc   A();
7*f4a2713aSLionel Sambuc };
8*f4a2713aSLionel Sambuc 
x()9*f4a2713aSLionel Sambuc A* x() {
10*f4a2713aSLionel Sambuc   return new A;
11*f4a2713aSLionel Sambuc }
12*f4a2713aSLionel Sambuc 
13*f4a2713aSLionel Sambuc struct B {
14*f4a2713aSLionel Sambuc   void* operator new(__typeof(sizeof(int)), int = 1, int = 4);
15*f4a2713aSLionel Sambuc   B(float);
16*f4a2713aSLionel Sambuc };
17*f4a2713aSLionel Sambuc 
y()18*f4a2713aSLionel Sambuc B* y() {
19*f4a2713aSLionel Sambuc   new (3,4) B(1);
20*f4a2713aSLionel Sambuc   return new(1) B(2);
21*f4a2713aSLionel Sambuc }
22*f4a2713aSLionel Sambuc 
23*f4a2713aSLionel Sambuc struct C {
24*f4a2713aSLionel Sambuc   void* operator new(__typeof(sizeof(int)), int, int = 4);
25*f4a2713aSLionel Sambuc   C();
26*f4a2713aSLionel Sambuc };
27*f4a2713aSLionel Sambuc 
z()28*f4a2713aSLionel Sambuc C* z() {
29*f4a2713aSLionel Sambuc   new (3,4) C;
30*f4a2713aSLionel Sambuc   return new(1) C;
31*f4a2713aSLionel Sambuc }
32*f4a2713aSLionel Sambuc 
33*f4a2713aSLionel Sambuc 
34