clang-tools-extra/pseudo/test/cxx/declarator-function.cpp
raw| 1 | // The standard grammar allows an init-list with any declarator, including |
| 2 | // a function declarator. This creates an ambiguity where a function-definition |
| 3 | // is misparsed as a simple-declaration. |
| 4 | |
| 5 | // RUN: clang-pseudo -grammar=cxx -source=%s --print-forest | FileCheck %s |
| 6 | void s(){}; |
| 7 | // CHECK-NOT: simple-declaration |
| 8 | // CHECK: function-definition := decl-specifier-seq function-declarator function-body |
| 9 | // CHECK-NOT: simple-declaration |