[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / AST / ast-dump-invalid-initialized.cpp
blob1c374ae716a9db527da013b62d89543249d6c0fb
1 // RUN: not %clang_cc1 -triple x86_64-unknown-unknown -Wno-unused-value -fcxx-exceptions -std=gnu++17 -ast-dump %s | FileCheck -strict-whitespace %s
3 struct A { A(int, int) {} };
4 class ForwardDecl;
6 void test() {
7 // Verify the valid-bit of the VarDecl.
9 // CHECK: `-VarDecl {{.*}} a1 'A'
10 A a1;
11 // CHECK: `-VarDecl {{.*}} a2 'const A'
12 const A a2;
13 // CHECK: `-VarDecl {{.*}} a3 'A'
14 A a3 = garbage();
15 // CHECK: `-VarDecl {{.*}} a4 'const A &'
16 const A& a4;
19 // CHECK: `-VarDecl {{.*}} invalid b2 'ForwardDecl'
20 ForwardDecl b2;
21 // CHECK: `-VarDecl {{.*}} invalid b3 'auto'
22 auto b3 = garbage();
23 // CHECK: `-VarDecl {{.*}} invalid b4 'auto'
24 auto b4 = A(1);
25 // CHECK: `-VarDecl {{.*}} invalid b5 'auto'
26 auto b5 = A{1};