bolt/deps/llvm-18.1.8/clang-tools-extra/pseudo/test/cxx/declarator-function.cpp
2025-02-14 19:21:04 +01:00

9 lines
455 B
C++

// 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.
// RUN: clang-pseudo -grammar=cxx -source=%s --print-forest | FileCheck %s
void s(){};
// CHECK-NOT: simple-declaration
// CHECK: function-definition := decl-specifier-seq function-declarator function-body
// CHECK-NOT: simple-declaration