Title
Incorrect example in overload resolution
Status
cd3
Section
12.2.4.3 [over.ics.rank]
Submitter
Nikolay Ivchenkov

Created on 2011-04-15.00:00:00 last changed 123 months ago

Messages

Date: 2012-02-15.00:00:00

[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]

Date: 2011-08-15.00:00:00

Proposed resolution (August, 2011):

Change the example in 12.2.4.3 [over.ics.rank] paragraph 3 bullet 1 sub-bullet 5 as follows:

  template<class T> int f(T&);
  template<class T> int f(T&&);
  int f(void(&)());     // #1
  int f(void(&&)());    // #2
  void g();
  int i1 = f(g);        // calls f(T&) #1
Date: 2012-09-24.00:00:00

The following example appears in 12.2.4.3 [over.ics.rank] paragraph 3:

  template<class T> int f(T&);
  template<class T> int f(T&&);
  void g();
  int i1 = f(g); // calls f(T&)

This is not correct. Because of the special deduction rule for rvalue reference parameters in 13.10.3.2 [temp.deduct.call] paragraph 3 and the reference-collapsing rules of 9.3.4.3 [dcl.ref] paragraph 6, the parameter type for both will be void(&)().

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2012-11-03 00:00:00adminsetstatus: dr -> drwp
2012-09-24 00:00:00adminsetmessages: + msg4012
2012-02-27 00:00:00adminsetmessages: + msg3829
2012-02-27 00:00:00adminsetstatus: ready -> dr
2011-04-15 00:00:00admincreate