summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/trivial-constructor-init.cpp
blob: da17799dfa4254e7c8490e50dd9f4cc670e5eaed (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// RUN: %clang_cc1 -emit-llvm %s -o - -std=c++11 -triple %itanium_abi_triple | FileCheck %s

extern "C" int printf(...);

struct S {
  S() { printf("S::S\n"); }
};

struct A {
  double x;
  A() : x(), y(), s() { printf("x = %f y = %x \n", x, y); }
  int *y;
  S s;
};

A a;

struct B {
  B() = default;
  B(const B&);
};

// CHECK-NOT: _ZL1b
static B b;

struct C {
  ~C();
};

// CHECK: _ZL1c
static C c[4];

int main() {
}

namespace PR22793 {
template <typename>
struct foo {
protected:
// CHECK-NOT: _ZN7PR227933fooIiED2Ev
  ~foo() = default;
  friend void func();
};

void func() { foo<int> f; }

template struct foo<int>;
}
OpenPOWER on IntegriCloud