blob: d691f97e598cc042561b2e4ff4482f75e2617039 [file] [log] [blame]
David Blaikie0cd9ede2013-05-09 21:32:04 +00001// RUN: %clang_cc1 -emit-llvm-only -g %s -o - | FileCheck %s
Anders Carlssonba397fe2009-11-06 18:45:16 +00002template<typename T> struct Identity {
3 typedef T Type;
4};
5
6void f(Identity<int>::Type a) {}
Anders Carlssona031b352009-11-06 19:19:55 +00007void f(Identity<int> a) {}
8void f(int& a) { }
Anders Carlsson5b6117a2009-11-14 21:08:12 +00009
10template<typename T> struct A {
11 A<T> *next;
12};
13void f(A<int>) { }
Anders Carlsson20f12a22009-12-06 18:00:51 +000014
15struct B { };
16
17void f() {
18 int B::*a = 0;
19 void (B::*b)() = 0;
20}
Eli Friedman3364e622010-01-16 00:43:13 +000021
22namespace EmptyNameCrash {
23 struct A { A(); };
24 typedef struct { A x; } B;
25 B x;
26}
Anders Carlsson4433f1c2010-01-26 05:19:50 +000027
28// PR4890
29namespace PR4890 {
30 struct X {
31 ~X();
32 };
33
34 X::~X() { }
35}
36
37namespace VirtualDtor {
38 struct Y {
39 virtual ~Y();
40 };
41
42 Y::~Y() { }
43}
Anders Carlssone70d3912010-01-26 05:26:39 +000044
45namespace VirtualBase {
46 struct A { };
47 struct B : virtual A { };
48
49 void f() {
50 B b;
51 }
52}
Devang Patele5848d62010-08-23 18:26:10 +000053
54void foo() {
55 const wchar_t c = L'x';
56 wchar_t d = c;
57}
Nick Lewycky7803ec82011-09-01 21:49:51 +000058
59namespace b5249287 {
60template <typename T> class A {
61 struct B;
62};
63
64class Cls {
65 template <typename T> friend class A<T>::B;
66};
67
68Cls obj;
69}
David Blaikie0cd9ede2013-05-09 21:32:04 +000070
71namespace pr9608 { // also pr9600
72struct incomplete;
73incomplete (*x)[3];
74// CHECK: metadata [[INCARRAYPTR:![0-9]*]], i32 0, i32 1, [3 x i8]** @_ZN6pr96081xE, null} ; [ DW_TAG_variable ] [x]
75// CHECK: [[INCARRAYPTR]] = {{.*}}metadata [[INCARRAY:![0-9]*]]} ; [ DW_TAG_pointer_type ]
76// CHECK: [[INCARRAY]] = {{.*}}metadata [[INCTYPE:![0-9]*]], metadata {{![0-9]*}}, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 0, align 0, offset 0] [from incomplete]
77// CHECK: [[INCTYPE]] = {{.*}} ; [ DW_TAG_structure_type ] [incomplete]{{.*}} [fwd]
78}