diff --git a/clang-tools-extra/pseudo/lib/cxx.bnf b/clang-tools-extra/pseudo/lib/cxx.bnf --- a/clang-tools-extra/pseudo/lib/cxx.bnf +++ b/clang-tools-extra/pseudo/lib/cxx.bnf @@ -409,7 +409,7 @@ noptr-declarator := noptr-declarator parameters-and-qualifiers noptr-declarator := noptr-declarator [ constant-expression_opt ] noptr-declarator := ( ptr-declarator ) -parameters-and-qualifiers := ( parameter-declaration-list_opt ) cv-qualifier-seq_opt ref-qualifier_opt noexcept-specifier_opt +parameters-and-qualifiers := ( parameter-declaration-clause_opt ) cv-qualifier-seq_opt ref-qualifier_opt noexcept-specifier_opt trailing-return-type := -> type-id ptr-operator := * cv-qualifier-seq_opt ptr-operator := & diff --git a/clang-tools-extra/pseudo/test/cxx/parameter-decl-clause.cpp b/clang-tools-extra/pseudo/test/cxx/parameter-decl-clause.cpp new file mode 100644 --- /dev/null +++ b/clang-tools-extra/pseudo/test/cxx/parameter-decl-clause.cpp @@ -0,0 +1,14 @@ +// RUN: clang-pseudo -grammar=%cxx-bnf-file -source=%s --print-forest | FileCheck %s +void foo2(int, ...); +// CHECK: translation-unit~simple-declaration := decl-specifier-seq init-declarator-list ; +// CHECK-NEXT: ├─decl-specifier-seq~VOID := +// CHECK-NEXT: ├─init-declarator-list~noptr-declarator := noptr-declarator parameters-and-qualifiers +// CHECK-NEXT: │ ├─noptr-declarator~IDENTIFIER := +// CHECK-NEXT: │ └─parameters-and-qualifiers := ( parameter-declaration-clause ) +// CHECK-NEXT: │ ├─( := +// CHECK-NEXT: │ ├─parameter-declaration-clause := parameter-declaration-list , ... +// CHECK-NEXT: │ │ ├─parameter-declaration-list~INT := +// CHECK-NEXT: │ │ ├─, := +// CHECK-NEXT: │ │ └─... := +// CHECK-NEXT: │ └─) := +// CHECK-NEXT: └─; := diff --git a/clang-tools-extra/pseudo/test/cxx/unsized-array.cpp b/clang-tools-extra/pseudo/test/cxx/unsized-array.cpp --- a/clang-tools-extra/pseudo/test/cxx/unsized-array.cpp +++ b/clang-tools-extra/pseudo/test/cxx/unsized-array.cpp @@ -1,6 +1,6 @@ // RUN: clang-pseudo -grammar=%cxx-bnf-file -source=%s --print-forest | FileCheck %s void s(int[]); -// CHECK: parameter-declaration-list~parameter-declaration := decl-specifier-seq abstract-declarator +// CHECK: parameter-declaration-clause~parameter-declaration := decl-specifier-seq abstract-declarator // CHECK-NEXT: ├─decl-specifier-seq~INT := tok[3] // CHECK-NEXT: └─abstract-declarator~noptr-abstract-declarator := [ ] // CHECK-NEXT: ├─[ := tok[4]