Skip to content

CWG3055 [over.call.object] Misleading body for surrogate call function #747

Description

@t3nsor

Full name of submitter: Brian Bi

Issue description: [over.call.object]/2 defines a surrogate call function as having the body { return F(a_1, ..., a_n); }. Such a body will be ill-formed if any of the parameter types are non-copyable, but will never be evaluated because [over.call]/1 specifies the behavior when a surrogate call function is selected by overload resolution.

Suggested resolution: Edit [over.call.object]/2 as follows:

[...] a surrogate call function with the unique name call-function and having the form
    R call-function (conversion-type-id F, P1 a1, …, Pn an) { return F (a1, …, an); } ;
is also considered as a candidate function.
[Note: If a surrogate call function is selected by overload resolution, the behavior is as described in [over.call]. —end note]
Similarly, surrogate call functions are added to the set of candidate functions for each non-explicit conversion function declared in a base class [...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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