blob: 1f25d5bce93cae385a7531b2c1dee249930e867e [file] [log] [blame]
Nico Weber253e80b2010-11-22 10:30:56 +00001// RUN: %clang_cc1 -ast-dump %s | FileCheck %s
2
3template<class T>
4class P {
5 public:
6 P(T* t) {}
7};
8
9namespace foo {
Nico Weber3a344f92013-01-22 17:00:09 +000010class A { public: A() {} };
Nico Weber253e80b2010-11-22 10:30:56 +000011enum B {};
12typedef int C;
13}
14
Nico Weber3a344f92013-01-22 17:00:09 +000015// CHECK: VarDecl {{0x[0-9a-fA-F]+}} <line:16:1, col:36> ImplicitConstrArray 'foo::A [2]'
16static foo::A ImplicitConstrArray[2];
17
Nico Weber253e80b2010-11-22 10:30:56 +000018int main() {
Abramo Bagnara0daaf322011-03-16 20:16:18 +000019 // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::A *'
Nico Weber253e80b2010-11-22 10:30:56 +000020 P<foo::A> p14 = new foo::A;
Abramo Bagnara0daaf322011-03-16 20:16:18 +000021 // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::B *'
Nico Weber253e80b2010-11-22 10:30:56 +000022 P<foo::B> p24 = new foo::B;
23 // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::C *'
24 P<foo::C> pr4 = new foo::C;
25}
Nico Weber76f11c92010-11-22 13:12:28 +000026
27foo::A getName() {
Abramo Bagnara0daaf322011-03-16 20:16:18 +000028 // CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} <col:10, col:17> 'foo::A'
Nico Weber76f11c92010-11-22 13:12:28 +000029 return foo::A();
30}