This is an archive of the discontinued LLVM Phabricator instance.

[pseudo] Allow mixed designated/undesignated init lists.
ClosedPublic

Authored by sammccall on Jun 27 2022, 4:13 PM.

Details

Summary

This isn't allowed by the standard grammar but is allowed in C, and clang/GCC
permit it as an extension.

It avoids the need to determine which type of list we have in error-recovery.

Diff Detail

Event Timeline

sammccall created this revision.Jun 27 2022, 4:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2022, 4:13 PM
sammccall requested review of this revision.Jun 27 2022, 4:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2022, 4:13 PM
hokein accepted this revision.Jun 28 2022, 6:38 AM
hokein added inline comments.
clang-tools-extra/pseudo/lib/cxx.bnf
468

I think this is the syntax of gnu extension, can we add a trailing comment for this rule?

This revision is now accepted and ready to land.Jun 28 2022, 6:38 AM
sammccall marked an inline comment as done.Jun 28 2022, 6:44 AM
sammccall added inline comments.
clang-tools-extra/pseudo/lib/cxx.bnf
468

Done - these are actually also legal in C. Also added to commit message.

(I don't love using trailing comments in this file - they feel hard to spot).

This revision was automatically updated to reflect the committed changes.
sammccall marked an inline comment as done.