Skip to content

CWG2711 [except.throw] It is not specified what the exception object is copy-initialized from #280

Closed
cplusplus/draft
#6328
@t3nsor

Description

@t3nsor

Full name of submitter: Brian Bi

Reference (section label): [except.throw]

Issue description: As pointed out by user 0x5f3759df on Stack Overflow, the normative wording in [expr.throw] and [except.throw] respectively specify the type of the exception object and the fact that the exception object is copy-initialized, but do not appear to specify that the exception object is copy-initialized from the assignment-expression operand.

Suggested resolution: Edit [except.throw]/3:

Throwing an exceptionA throw-expression ([expr.throw]) with an operand copy-initializes (9.4, 11.4.5.3) a temporary object, called the exception object, from its operand. If the type of the exception object would be an incomplete type, an abstract class type (11.7.4), or a pointer to an incomplete type other than cv void the program is ill-formed.

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