Skip to content

CWG3212 [stmt.if] Misleadingly phrased disambiguation rule #947

Description

@t3nsor

Full name of submitter: Brian Bi

Issue description: The last sentence of [stmt.if]/1 reads as a semantic constraint when it is intended to be a grammatical disambiguation rule:

[...] In the second form of if statement (the one including else), if the first substatement is also an if statement then that inner if statement shall contain an else part.[Footnote 67: In other words, the else is associated with the nearest un-elsed if.]

Suggested resolution: Replace the quoted sentence with the following, but retain the footnote:

A selection-statement is never interpreted as an if statement having two substatements if the first such substatement would be an if statement having only one substatement.[Footnote 67: ...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions