blob: c883584fe02f3f5393fa3c47f3562cc4656b3c24 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -emit-llvm -o %t %s
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00002// RUN: grep "_ZN1CC1ERK1C" %t | count 0
3// RUN: grep "_ZN1SC1ERK1S" %t | count 0
Fariborz Jahanian6904cbb2009-08-06 01:02:49 +00004
5extern "C" int printf(...);
6
7
8struct C {
Mike Stump1eb44332009-09-09 15:08:12 +00009 C() : iC(6) {printf("C()\n"); }
10 C(const C& c) { printf("C(const C& c)\n"); }
11 int iC;
Fariborz Jahanian6904cbb2009-08-06 01:02:49 +000012};
13
14C foo() {
15 return C();
16};
17
18class X { // ...
19public:
Mike Stump1eb44332009-09-09 15:08:12 +000020 X(int) {}
21 X(const X&, int i = 1, int j = 2, C c = foo()) {
22 printf("X(const X&, %d, %d, %d)\n", i, j, c.iC);
23 }
Fariborz Jahanian6904cbb2009-08-06 01:02:49 +000024};
25
Fariborz Jahanian343a3cf2009-08-14 20:11:43 +000026
27struct S {
28 S();
29};
30
31S::S() { printf("S()\n"); }
32
33void Call(S) {};
34
Mike Stump1eb44332009-09-09 15:08:12 +000035int main() {
36 X a(1);
37 X b(a, 2);
38 X c = b;
39 X d(a, 5, 6);
40 S s;
41 Call(s);
Fariborz Jahanian6904cbb2009-08-06 01:02:49 +000042}