forked from OSchip/llvm-project
[pseudo] Fix noptr-abstract-declarator rule.
The const-expression in the [] can be empty. Differential Revision: https://reviews.llvm.org/D126992
This commit is contained in:
parent
7fa97b473c
commit
58b33bc8c4
|
@ -429,7 +429,7 @@ abstract-declarator := abstract-pack-declarator
|
|||
ptr-abstract-declarator := noptr-abstract-declarator
|
||||
ptr-abstract-declarator := ptr-operator ptr-abstract-declarator_opt
|
||||
noptr-abstract-declarator := noptr-abstract-declarator_opt parameters-and-qualifiers
|
||||
noptr-abstract-declarator := noptr-abstract-declarator_opt [ constant-expression ]
|
||||
noptr-abstract-declarator := noptr-abstract-declarator_opt [ constant-expression_opt ]
|
||||
noptr-abstract-declarator := ( ptr-abstract-declarator )
|
||||
abstract-pack-declarator := noptr-abstract-pack-declarator
|
||||
abstract-pack-declarator := ptr-operator abstract-pack-declarator
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// 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-NEXT: ├─decl-specifier-seq~INT := tok[3]
|
||||
// CHECK-NEXT: └─abstract-declarator~noptr-abstract-declarator := [ ]
|
||||
// CHECK-NEXT: ├─[ := tok[4]
|
||||
// CHECK-NEXT: └─] := tok[5]
|
Loading…
Reference in New Issue