summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/default-arg-temps.cpp
blob: 8385aff6291c755c16fc2d0e17db448fa0709180 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// RUN: clang-cc -emit-llvm %s -o %t -triple=x86_64-apple-darwin9 && 

struct T {
  T();
  ~T();
};

void f(const T& t = T());

class X { // ...
public:
        X();
        X(const X&, const T& t = T());
};

void g() {
  // RUN: grep "call void @_ZN1TC1Ev" %t | count 4 &&
  // RUN: grep "call void @_ZN1TD1Ev" %t | count 4 &&
  f();
  f();

  X a;
  X b(a);
  X c = a;
}


// RUN: grep memset %t
class obj{ int a; float b; double d; };
void h() {
  obj o = obj();
}
OpenPOWER on IntegriCloud