This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa1a1a78ac8cf: [pseudo] Eliminate an ambiguity for the empty 
member declaration. (authored by hokein).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131724/new/

https://reviews.llvm.org/D131724

Files:
  clang-tools-extra/pseudo/lib/cxx/cxx.bnf
  clang-tools-extra/pseudo/test/cxx/empty-member-declaration.cpp


Index: clang-tools-extra/pseudo/test/cxx/empty-member-declaration.cpp
===================================================================
--- /dev/null
+++ clang-tools-extra/pseudo/test/cxx/empty-member-declaration.cpp
@@ -0,0 +1,7 @@
+// RUN: clang-pseudo -grammar=cxx -source=%s --print-forest 
--forest-abbrev=false | FileCheck %s
+class A {
+    ;
+// CHECK-NOT: member-declaration := ;
+// CHECK: member-declaration := empty-declaration
+// CHECK-NOT: member-declaration := ;
+};
Index: clang-tools-extra/pseudo/lib/cxx/cxx.bnf
===================================================================
--- clang-tools-extra/pseudo/lib/cxx/cxx.bnf
+++ clang-tools-extra/pseudo/lib/cxx/cxx.bnf
@@ -557,7 +557,8 @@
 class-key := UNION
 member-specification := member-declaration member-specification_opt
 member-specification := access-specifier : member-specification_opt
-member-declaration := decl-specifier-seq_opt member-declarator-list_opt ;
+member-declaration := decl-specifier-seq member-declarator-list_opt ;
+member-declaration := member-declarator-list ;
 member-declaration := function-definition
 member-declaration := using-declaration
 member-declaration := using-enum-declaration


Index: clang-tools-extra/pseudo/test/cxx/empty-member-declaration.cpp
===================================================================
--- /dev/null
+++ clang-tools-extra/pseudo/test/cxx/empty-member-declaration.cpp
@@ -0,0 +1,7 @@
+// RUN: clang-pseudo -grammar=cxx -source=%s --print-forest --forest-abbrev=false | FileCheck %s
+class A {
+    ;
+// CHECK-NOT: member-declaration := ;
+// CHECK: member-declaration := empty-declaration
+// CHECK-NOT: member-declaration := ;
+};
Index: clang-tools-extra/pseudo/lib/cxx/cxx.bnf
===================================================================
--- clang-tools-extra/pseudo/lib/cxx/cxx.bnf
+++ clang-tools-extra/pseudo/lib/cxx/cxx.bnf
@@ -557,7 +557,8 @@
 class-key := UNION
 member-specification := member-declaration member-specification_opt
 member-specification := access-specifier : member-specification_opt
-member-declaration := decl-specifier-seq_opt member-declarator-list_opt ;
+member-declaration := decl-specifier-seq member-declarator-list_opt ;
+member-declaration := member-declarator-list ;
 member-declaration := function-definition
 member-declaration := using-declaration
 member-declaration := using-enum-declaration
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to