cplusplus / CWG

Core Working Group
23 stars 7 forks source link

[basic.scope.scope] p3 The type of the implicit object parameter is not defined #539

Open xmh0511 opened 1 month ago

xmh0511 commented 1 month ago

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

[basic.scope.scope] p3 says:

Two non-static member functions have corresponding object parameters if:

  • exactly one is an implicit object member function with no ref-qualifier and the types of their object parameters ([dcl.fct]), after removing top-level references, are the same, or
  • their object parameters have the same type.

If their object parameters are implicit, the document didn't define the type for an implicit object parameter. [over.match.funcs.general] p4 defines the type for implicit object parameter:

For implicit object member functions, the type of the implicit object parameter is

However, this definition is limited to

The source transformations and constructions defined in these subclauses are only for the purpose of describing the overload resolution process.

frederick-vs-ja commented 1 month ago

What happens if we strike

The source transformations and constructions defined in these subclauses are only for the purpose of describing the overload resolution process. An implementation is not required to use such transformations and constructions.

from [over.match.funcs.general] p1?

At least the last sentence is probably redundant due to the as-if rule.

xmh0511 commented 1 month ago

If the sentence can be stroked from [over.match.funcs.general] p1, [over.match.funcs.general] p4 about defining the type of implicit object parameters should be moved to [dcl.fct].