Title
Deduction of reference conversions
Status
cd1
Section
13.10.3.4 [temp.deduct.conv]
Submitter
Jason Merrill

Created on 2001-11-14.00:00:00 last changed 197 months ago

Messages

Date: 2003-04-15.00:00:00

[Voted into WP at April 2003 meeting.]

Date: 2002-04-15.00:00:00

Proposed Resolution (4/02):

Change the last chunk of 13.10.3.4 [temp.deduct.conv] paragraph 2 from

If A is a cv-qualified type, the top level cv-qualifiers of A's type are ignored for type deduction. If A is a reference type, the type referred to by A is used for type deduction.
to
If A is a cv-qualified type, the top level cv-qualifiers of A's type are ignored for type deduction. If A is a reference type, the type referred to by A is used for type deduction. If P is a reference type, the type referred to by P is used for type deduction.

Date: 2004-09-10.00:00:00

Consider:

  struct S {
    template <class T> operator T& ();
  };

  int main ()
  {
    S s;
    int i = static_cast<int&> (s);
  }
13.10.3.4 [temp.deduct.conv] says that we strip the reference from int&, but doesn't say anything about T&. As a result, P (T&) and A (int) have incompatible forms and deduction fails.

History
Date User Action Args
2008-10-05 00:00:00adminsetstatus: wp -> cd1
2003-04-25 00:00:00adminsetmessages: + msg877
2003-04-25 00:00:00adminsetstatus: ready -> wp
2002-11-08 00:00:00adminsetstatus: review -> ready
2002-05-10 00:00:00adminsetmessages: + msg636
2002-05-10 00:00:00adminsetstatus: open -> review
2001-11-14 00:00:00admincreate