cplusplus / CWG

Core Working Group
23 stars 7 forks source link

[dcl.fct] p9 non-object-parameter-type-list does not cover non-member functions #529

Open xmh0511 opened 2 months ago

xmh0511 commented 2 months ago

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

[basic.scope.scope] p4 says

Two function or function template declarations declare corresponding overloads if:

  • both declare functions with the same non-object-parameter-type-list,

This should cover non-member functions. However the definition of non-object-parameter-type-list, as per [dcl.fct] p9, says

The non-object-parameter-type-list of a member function is the parameter-type-list of that function with the explicit object parameter, if any, omitted.

What is the non-object-parameter-type-list of a non-member function? There is no relevant wording.

Suggested Resolution

The non-object-parameter-type-list of a function is:

  • For a member function, the parameter-type-list of that function with the explicit object parameter, if any, omitted.
  • For a non-member function, the parameter-type-list of that function.
frederick-vs-ja commented 2 months ago

cplusplus/draft#6377 might be related.