HomePhabricator

P0305R1: Parsing support for init-statements in 'if' and 'switch' statements.

Description

P0305R1: Parsing support for init-statements in 'if' and 'switch' statements.
No semantic analysis yet.

This is a pain to disambiguate correctly, because the parsing rules for the
declaration form of a condition and of an init-statement are quite different --
for a token sequence that looks like a declaration, we frequently need to
disambiguate all the way to the ')' or ';'.

We could do better here in some cases by stopping disambiguation once we've
decided whether we've got an expression or not (rather than keeping going until
we know whether it's an init-statement declaration or a condition declaration),
by unifying our parsing code for the two types of declaration and moving the
syntactic checks into Sema; if this has a measurable impact on parsing
performance, I'll look into that.

Details

Committed
rsmithJun 29 2016, 2:17 PM
Parents
rL274168: [ClangConfig] Copy ClangConfig.cmake to…
Branches
Unknown
Tags
Unknown