// RUN: %clang_cc1 -triple i686-mingw32 -ast-dump %s | FileCheck %s // RUN: %clang_cc1 -triple i686-mingw32 -std=c++1z -ast-dump %s | FileCheck %s -check-prefix=CHECK-1Z template class P { public: P(T* t) {} }; namespace foo { class A { public: A(int = 0) {} }; enum B {}; typedef int C; } // CHECK: VarDecl {{0x[0-9a-fA-F]+}} col:15 ImplicitConstrArray 'foo::A [2]' static foo::A ImplicitConstrArray[2]; 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(); } void destruct(foo::A *a1, foo::A *a2, P *p1) { // CHECK: MemberExpr {{0x[0-9a-fA-F]+}} '' ->~A a1->~A(); // CHECK: MemberExpr {{0x[0-9a-fA-F]+}} '' ->~A a2->foo::A::~A(); // CHECK: MemberExpr {{0x[0-9a-fA-F]+}} '' ->~P p1->~P(); } struct D { D(int); ~D(); }; void construct() { using namespace foo; A a = A(12); // CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} 'foo::A' 'void (int){{( __attribute__\(\(thiscall\)\))?}}' D d = D(12); // CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} 'D' 'void (int){{( __attribute__\(\(thiscall\)\))?}}' } void abort() __attribute__((noreturn)); namespace std { typedef decltype(sizeof(int)) size_t; template struct initializer_list { const E *p; size_t n; initializer_list(const E *p, size_t n) : p(p), n(n) {} }; template struct pair { F f; S s; pair(const F &f, const S &s) : f(f), s(s) {} }; struct string { const char *str; string() { abort(); } string(const char *S) : str(S) {} ~string() { abort(); } }; template struct map { using T = pair; map(initializer_list i, const string &s = string()) {} ~map() { abort(); } }; }; // namespace std #if __cplusplus >= 201703L // CHECK-1Z: FunctionDecl {{.*}} construct_with_init_list std::map construct_with_init_list() { // CHECK-1Z-NEXT: CompoundStmt // CHECK-1Z-NEXT: ReturnStmt {{.*}} {{0, 0}}; } // CHECK-1Z: NamespaceDecl {{.*}} in_class_init namespace in_class_init { struct A {}; // CHECK-1Z: CXXRecordDecl {{.*}} struct B definition struct B { // CHECK-1Z: FieldDecl {{.*}} a 'in_class_init::A' // CHECK-1Z-NEXT: InitListExpr {{.*}}