
This eliminates some simple-declaration/function-definition false parses. - implement a function to determine whether a declarator ForestNode is a function declarator; - extend the standard declarator to two guarded function-declarator and non-function-declarator nonterminals; Differential Revision: https://reviews.llvm.org/D129222
10 lines
449 B
C++
10 lines
449 B
C++
// 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.
|
|
|
|
// RUN: clang-pseudo -grammar=cxx -source=%s --print-forest | FileCheck %s
|
|
void (*s)(){};
|
|
// CHECK-NOT: function-definition
|
|
// CHECK: init-declarator := non-function-declarator initializer
|
|
// CHECK-NOT: function-definition
|