[PATCH] D126992: [pseudo] Fix noptr-abstract-declarator rule.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 7 01:22:48 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
hokein marked an inline comment as done.
Closed by commit rG58b33bc8c48a: [pseudo] Fix noptr-abstract-declarator rule. (authored by hokein).
Changed prior to commit:
https://reviews.llvm.org/D126992?vs=434106&id=434726#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126992/new/
https://reviews.llvm.org/D126992
Files:
clang-tools-extra/pseudo/lib/cxx.bnf
clang-tools-extra/pseudo/test/cxx/unsized-array.cpp
Index: clang-tools-extra/pseudo/test/cxx/unsized-array.cpp
===================================================================
--- /dev/null
+++ clang-tools-extra/pseudo/test/cxx/unsized-array.cpp
@@ -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]
Index: clang-tools-extra/pseudo/lib/cxx.bnf
===================================================================
--- clang-tools-extra/pseudo/lib/cxx.bnf
+++ clang-tools-extra/pseudo/lib/cxx.bnf
@@ -429,7 +429,7 @@
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126992.434726.patch
Type: text/x-patch
Size: 1404 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220607/c1f70063/attachment.bin>
More information about the cfe-commits
mailing list