Skip to content

clang++ incorrectly accepts addition with an array prvalue operand #54016

Description

@languagelawyer
int main()
{
    using IA = int[];

    IA{ 1, 2, 3 } + 0;
}

[expr.add]/1:

For addition, either both operands shall have arithmetic or unscoped enumeration type, or one operand shall be a pointer to a completely-defined object type and the other shall have integral or unscoped enumeration type.

Array types are not allowed. Neither there is wording requiring the array-to-pointer conversion on a prvalue array operand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions