This revision was automatically updated to reflect the committed changes.
sammccall marked an inline comment as done.
Closed by commit rG6b187fdf3bb4: [pseudo] Add xfail tests for a 
simple-declaration/function-definition ambiguity (authored by sammccall).

Changed prior to commit:
  https://reviews.llvm.org/D127400?vs=435510&id=439380#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127400

Files:
  clang-tools-extra/pseudo/test/cxx/declarator-function.cpp
  clang-tools-extra/pseudo/test/cxx/declarator-var.cpp


Index: clang-tools-extra/pseudo/test/cxx/declarator-var.cpp
===================================================================
--- /dev/null
+++ clang-tools-extra/pseudo/test/cxx/declarator-var.cpp
@@ -0,0 +1,11 @@
+// The standard grammar allows an function-body to use any declarator, 
including
+// a non-function declarator. This creates an ambiguity where a
+// simple-declaration is misparsed as a function-definition.
+// FIXME: eliminate this false parse.
+// XFAIL: *
+
+// RUN: clang-pseudo -grammar=%cxx-bnf-file -source=%s --print-forest | 
FileCheck %s
+void (*s)(){};
+// CHECK-NOT:      function-definition
+// CHECK:          init-declarator := declarator initializer
+// CHECK-NOT:      function-definition
Index: clang-tools-extra/pseudo/test/cxx/declarator-function.cpp
===================================================================
--- /dev/null
+++ clang-tools-extra/pseudo/test/cxx/declarator-function.cpp
@@ -0,0 +1,11 @@
+// The standard grammar allows an init-list with any declarator, including
+// a function declarator. This creates an ambiguity where a function-definition
+// is misparsed as a simple-declaration.
+// FIXME: eliminate this false parse.
+// XFAIL: *
+
+// RUN: clang-pseudo -grammar=%cxx-bnf-file -source=%s --print-forest | 
FileCheck %s
+void s(){};
+// CHECK-NOT:      simple-declaration
+// CHECK:          function-definition := decl-specifier-seq declarator
+// function-body CHECK-NOT:      simple-declaration


Index: clang-tools-extra/pseudo/test/cxx/declarator-var.cpp
===================================================================
--- /dev/null
+++ clang-tools-extra/pseudo/test/cxx/declarator-var.cpp
@@ -0,0 +1,11 @@
+// The standard grammar allows an function-body to use any declarator, including
+// a non-function declarator. This creates an ambiguity where a
+// simple-declaration is misparsed as a function-definition.
+// FIXME: eliminate this false parse.
+// XFAIL: *
+
+// RUN: clang-pseudo -grammar=%cxx-bnf-file -source=%s --print-forest | FileCheck %s
+void (*s)(){};
+// CHECK-NOT:      function-definition
+// CHECK:          init-declarator := declarator initializer
+// CHECK-NOT:      function-definition
Index: clang-tools-extra/pseudo/test/cxx/declarator-function.cpp
===================================================================
--- /dev/null
+++ clang-tools-extra/pseudo/test/cxx/declarator-function.cpp
@@ -0,0 +1,11 @@
+// The standard grammar allows an init-list with any declarator, including
+// a function declarator. This creates an ambiguity where a function-definition
+// is misparsed as a simple-declaration.
+// FIXME: eliminate this false parse.
+// XFAIL: *
+
+// RUN: clang-pseudo -grammar=%cxx-bnf-file -source=%s --print-forest | FileCheck %s
+void s(){};
+// CHECK-NOT:      simple-declaration
+// CHECK:          function-definition := decl-specifier-seq declarator
+// function-body CHECK-NOT:      simple-declaration
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to