This is an archive of the discontinued LLVM Phabricator instance.

[pseudo] Add xfail tests for a simple-declaration/function-definition ambiguity
ClosedPublic

Authored by sammccall on Jun 9 2022, 5:14 AM.

Details

Summary

I expect to eliminate this ambiguity at the grammar level by use of guards,
because it interferes with brace-based error recvoery.

Diff Detail

Event Timeline

sammccall created this revision.Jun 9 2022, 5:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2022, 5:14 AM
sammccall requested review of this revision.Jun 9 2022, 5:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2022, 5:14 AM
hokein accepted this revision.Jun 9 2022, 5:49 AM
hokein added inline comments.
clang-tools-extra/pseudo/test/cxx/declarator-function.cpp
13

nit: the line seems to be broken by the clang-format.

clang-tools-extra/pseudo/test/cxx/declarator-var.cpp
11

why we need two lines for function-definition?
because of the undeterministic order of the ambiguous results (we don't know whether function-def comes first or the var-decl comes first)?

This revision is now accepted and ready to land.Jun 9 2022, 5:49 AM
sammccall marked 2 inline comments as done.Jun 23 2022, 6:52 AM
sammccall added inline comments.
clang-tools-extra/pseudo/test/cxx/declarator-var.cpp
11

Right, we want to forbid function-definition whether it's first or second.

In a more complicated example I might use -implicit-check-not but I think this is clearer: hiding assertions in the FileCheck invocation is non-obvious.