Skip to content

[expr.prim.lambda.closure] Closure types are not required to be non-finalΒ #832

@Halalaluyafail3

Description

@Halalaluyafail3

Full name of submitter (unless configured in github; will be published with the issue): Jay Ghiron

Reference (section label): [expr.prim.lambda.closure]/1

The type of a lambda-expression (which is also the type of the closure object) is a unique, unnamed non-union class type, called the closure type, whose properties are described below.

Issue description:

It is not stated that the closure type must be non-final. Inheriting from a lambda is frequently used with std::visit to create ad hoc overload sets, and presumably the purpose of specifying non-union classes is to allow for this.

Suggested resolution:

Modify [expr.prim.lambda.closure]/1 as follows:

The type of a lambda-expression (which is also the type of the closure object) is a unique, unnamed non-union non-final class type, called the closure type, whose properties are described below.

Where the word final is colored as a keyword, as it is in [derivation]/4.

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