From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/SemaCXX/sourceranges.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 clang/test/SemaCXX/sourceranges.cpp (limited to 'clang/test/SemaCXX/sourceranges.cpp') diff --git a/clang/test/SemaCXX/sourceranges.cpp b/clang/test/SemaCXX/sourceranges.cpp new file mode 100644 index 0000000..0537aa2 --- /dev/null +++ b/clang/test/SemaCXX/sourceranges.cpp @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -ast-dump %s | FileCheck %s + +template +class P { + public: + P(T* t) {} +}; + +namespace foo { +class A {}; +enum B {}; +typedef int C; +} + +int main() { + // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} 'foo::A *' + P p14 = new foo::A; + // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} 'foo::B *' + P p24 = new foo::B; + // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} 'foo::C *' + P pr4 = new foo::C; +} + +foo::A getName() { + // CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} 'foo::A' + return foo::A(); +} -- cgit v1.2.3