Skip to content

[over.oper.general] p7 Precedence is not a formal wording nor specified #5475

@xmh0511

Description

@xmh0511

[over.oper.general] p7 says

It is not possible to change the precedence, grouping, or number of operands of operators.

The "precedence" is not directly specified in this document, it is implied by the syntaxes of the grammar of expressions. [expr.footnote] p42 says

The precedence of operators is not directly specified, but it can be derived from the syntax.

It is plausible to use syntax in this wording to imply the precedence is not changed.

It is not possible to change the syntax, grouping, or number of operands of operators.

A + B * C;

Assume that A, B, and C are of class types. The expression is interpreted as additive-expression + multiplicative-expression rather than additive-expression * id-expression.

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