1// RUN: clang-pseudo -grammar=cxx -source=%s --print-forest | FileCheck %s
2
3// not parsed as Type{foo} Type{bar}
4foo bar;
5// CHECK-NOT: simple-declaration := decl-specifier-seq ;
6// CHECK: simple-declaration := decl-specifier-seq init-declarator-list ;
7// CHECK: ├─decl-specifier-seq~simple-type-specifier
8// CHECK: ├─init-declarator-list~IDENTIFIER
9// CHECK: └─;
10// CHECK-NOT: simple-declaration := decl-specifier-seq ;
11
12// not parsed as Type{std} Type{::string} Declarator{s};
13std::string s;
14// CHECK-NOT: nested-name-specifier := ::
15// CHECK: simple-declaration := decl-specifier-seq init-declarator-list ;
16// CHECK: ├─decl-specifier-seq~simple-type-specifier := <ambiguous>
17// CHECK: │ ├─simple-type-specifier := nested-name-specifier type-name
18// CHECK: │ │ ├─nested-name-specifier := <ambiguous> #1
19// CHECK: │ │ │ ├─nested-name-specifier := type-name ::
20// CHECK: │ │ │ └─nested-name-specifier := namespace-name ::
21// CHECK: │ │ └─type-name
22// CHECK: │ └─simple-type-specifier := nested-name-specifier template-name
23// CHECK: │ ├─nested-name-specifier =#1
24// CHECK: │ └─template-name~IDENTIFIER
25// CHECK: ├─init-declarator-list~IDENTIFIER
26// CHECK: └─;
27// CHECK-NOT: nested-name-specifier := ::
28

source code of clang-tools-extra/pseudo/test/cxx/decl-specfier-seq.cpp