Title
Issues in 17.6.5.5 rules for member functions
Status
c++17
Section
[member.functions]
Submitter
Richard Smith

Created on 2013-05-12.00:00:00 last changed 82 months ago

Messages

Date: 2015-05-07.21:44:43

Proposed resolution:

This wording is relative to N3797.

  1. Merge [member.functions]p2+3 as indicated:

    -2- An implementation may declare additional non-virtual member function signatures within a class:

    • by adding arguments with default values to a member function signature;188 [Note: An implementation may not add arguments with default values to virtual, global, or non-member functions. — end note]

    • by replacing a member function signature with default values by two or more member function signatures with equivalent behavior; and

    • by adding a member function signature for a member function name.

    -3- A call to a member function signature described in the C++ standard library behaves as if the implementation declares no additional member function signatures.[Footnote: A valid C++ program always calls the expected library member function, or one with equivalent behavior. An implementation may also define additional member functions that would otherwise not be called by a valid C++ program.] For a non-virtual member function described in the C++ standard library, an implementation may declare a different set of member function signatures, provided that any call to the member function that would select an overload from the set of declarations described in this standard behaves as if that overload were selected. [Note: For instance, an implementation may add parameters with default values, or replace a member function with default arguments with two or more member functions with equivalent behavior, or add additional signatures for a member function name. — end note]

Date: 2015-05-07.21:44:43

[ 2015-05, Lenexa ]

JW: I don't like that this loses the footnote about the address of member functions having an unspecified type, the footnote is good to be able to point to as an explicit clarification of one consequence of the normative wording.
MC: so we want to keep the footnote
STL: doesn't need to be a footnote, can be an inline Note
JW: does this have any impact on our ability to add totally different functions with unrelated names, not described in the standard?
MC: no, the old wording didn't refer to such functions anyway
Move to Ready and include in motion on Friday?
9 in favor, 0 opposed, 2 abstention

Date: 2013-12-11.00:00:00

[ 2013-12-11 Richard provides concrete wording ]

Date: 2013-05-12.00:00:00

[member.functions] p2 says:

"An implementation may declare additional non-virtual member function signatures within a class:

  • by adding arguments with default values to a member function signature; [Footnote: Hence, the address of a member function of a class in the C++ standard library has an unspecified type.] [Note: An implementation may not add arguments with default values to virtual, global, or non-member functions. — end note]
  • by replacing a member function signature with default values by two or more member function signatures with equivalent behavior; and
  • by adding a member function signature for a member function name."
  1. This wording is not using the correct terminology. "by adding arguments with default values" presumably means "by adding parameters with default arguments", and likewise throughout.

  2. This paragraph only allows an implementation to declare "additional" signatures, but the first bullet is talking about replacing a standard signature with one with additional parameters.

  3. None of these bullets allows a member function with no ref-qualifier to be replaced by signatures with ref-qualifiers (a situation which was just discussed on std-proposals), and likewise for cv-qualifiers. Presumably that is not intentional, and such changes should be permissible.

I think the first two items are probably editorial, since the intent is clear.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2015-10-27 16:52:45adminsetstatus: ready -> wp
2015-05-07 21:44:43adminsetmessages: + msg7383
2015-05-07 21:44:43adminsetstatus: new -> ready
2014-01-12 18:16:44adminsetmessages: + msg6787
2014-01-12 18:16:44adminsetmessages: + msg6786
2013-05-12 00:00:00admincreate