Movatterモバイル変換


[0]ホーム

URL:


Issue 1374 - WG21 CWG Issues
Title
Qualification conversion vs difference in reference binding
Status
cd3
Section
12.2.4.3 [over.ics.rank]
Submitter
Michael Wong

Created on2011-08-15.00:00:00 last changed145 months ago

Messages

msg4420 (view)
Date: 2013-04-15.00:00:00

[Moved to DR at the April, 2013 meeting.]

msg3761 (view)
Date: 2012-02-15.00:00:00

Proposed resolution (February, 2012):

Move 12.2.4.3 [over.ics.rank] paragraph 3, first bullet, thirdsub-bullet, after the current fifth sub-bullet, as follows:

Two implicit conversion sequences of the same form areindistinguishable conversion sequences unless one of the followingrules applies:

  • Standard conversion sequenceS1 is a betterconversion sequence...

    • S1 is a proper subsequence ofS2...

    • the rank ofS1 is better...

    • S1 andS2 differ only in theirqualification conversion... —end example] or if notthat,

    • S1 andS2 are reference bindings(9.5.4 [dcl.init.ref]) and neither refers... or if notthat,

    • S1 andS2 are reference bindings(9.5.4 [dcl.init.ref]) and S1 binds... —endexample]or if not that,

    • S1 andS2 differ only in theirqualification conversion... —end example]or if not that,

    • S1 andS2 are reference bindings(9.5.4 [dcl.init.ref]), and the types to which the referencesrefer...

  • User-defined conversion sequenceU1...
msg3760 (view)
Date: 2012-02-15.00:00:00

Notes from the February, 2012 meeting:

The CWG agreed that bullets 3 and 4 should be reversed, to checkthe reference binding first and then for qualification conversion.

msg3657 (view)
Date: 2011-08-15.00:00:00

The rule in 12.2.4.3 [over.ics.rank] paragraph 3 for rankingbased on a difference in qualification conversion applies only if they"differ only in their qualification conversion".

It is unclear as to whether the property of being a referencebinding is a factor in determining if there is a differencebetween conversion sequences. Notice that 12.2.4.2.5 [over.ics.ref] maps reference bindings to other forms ofimplicit conversion sequences, but does not state that theproperty of being a reference binding is preserved; however,12.2.4.3 [over.ics.rank] has cases which depend on whethercertain standard conversion sequences are reference bindings ornot and on the specifics of the bindings.

In the following, pickingT2 && would bind anrvalue to an rvalue reference. PickingT1 & wouldbind an rvalue to an lvalue reference, but the qualificationconversion toT1 is "better". Which is better?

    typedef int *      *      *const *const T1;    typedef int *const *const *const *const T2;    void foo(T1 &);    void foo(T2 &&) { }    int main() {       foo((int ****)0);       return 0;    }
History
DateUserActionArgs
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-10-14 00:00:00adminsetstatus: dr -> drwp
2013-05-03 00:00:00adminsetmessages: +msg4420
2013-05-03 00:00:00adminsetstatus: ready -> dr
2012-11-03 00:00:00adminsetstatus: review -> ready
2012-02-27 00:00:00adminsetmessages: +msg3761
2012-02-27 00:00:00adminsetmessages: +msg3760
2012-02-27 00:00:00adminsetstatus: open -> review
2011-08-15 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp