1f4a2713aSLionel Sambuc // RUN: %clang_cc1 -ast-dump %s | FileCheck %s
2f4a2713aSLionel Sambuc
3f4a2713aSLionel Sambuc template<class T>
4f4a2713aSLionel Sambuc class P {
5f4a2713aSLionel Sambuc public:
P(T * t)6f4a2713aSLionel Sambuc P(T* t) {}
7f4a2713aSLionel Sambuc };
8f4a2713aSLionel Sambuc
9f4a2713aSLionel Sambuc namespace foo {
A()10f4a2713aSLionel Sambuc class A { public: A() {} };
11f4a2713aSLionel Sambuc enum B {};
12f4a2713aSLionel Sambuc typedef int C;
13f4a2713aSLionel Sambuc }
14f4a2713aSLionel Sambuc
15*0a6a1f1dSLionel Sambuc // CHECK: VarDecl {{0x[0-9a-fA-F]+}} <line:16:1, col:36> col:15 ImplicitConstrArray 'foo::A [2]'
16f4a2713aSLionel Sambuc static foo::A ImplicitConstrArray[2];
17f4a2713aSLionel Sambuc
main()18f4a2713aSLionel Sambuc int main() {
19f4a2713aSLionel Sambuc // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::A *'
20f4a2713aSLionel Sambuc P<foo::A> p14 = new foo::A;
21f4a2713aSLionel Sambuc // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::B *'
22f4a2713aSLionel Sambuc P<foo::B> p24 = new foo::B;
23f4a2713aSLionel Sambuc // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::C *'
24f4a2713aSLionel Sambuc P<foo::C> pr4 = new foo::C;
25f4a2713aSLionel Sambuc }
26f4a2713aSLionel Sambuc
getName()27f4a2713aSLionel Sambuc foo::A getName() {
28f4a2713aSLionel Sambuc // CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} <col:10, col:17> 'foo::A'
29f4a2713aSLionel Sambuc return foo::A();
30f4a2713aSLionel Sambuc }
31*0a6a1f1dSLionel Sambuc
destruct(foo::A * a1,foo::A * a2,P<int> * p1)32*0a6a1f1dSLionel Sambuc void destruct(foo::A *a1, foo::A *a2, P<int> *p1) {
33*0a6a1f1dSLionel Sambuc // CHECK: MemberExpr {{0x[0-9a-fA-F]+}} <col:3, col:8> '<bound member function type>' ->~A
34*0a6a1f1dSLionel Sambuc a1->~A();
35*0a6a1f1dSLionel Sambuc // CHECK: MemberExpr {{0x[0-9a-fA-F]+}} <col:3, col:16> '<bound member function type>' ->~A
36*0a6a1f1dSLionel Sambuc a2->foo::A::~A();
37*0a6a1f1dSLionel Sambuc // CHECK: MemberExpr {{0x[0-9a-fA-F]+}} <col:3, col:13> '<bound member function type>' ->~P
38*0a6a1f1dSLionel Sambuc p1->~P<int>();
39*0a6a1f1dSLionel Sambuc }
40