This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 114a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-04-18


2385. Lookup for conversion-function-ids

Section: 7.5.4.3  [expr.prim.id.qual]     Status: CD5     Submitter: John Spicer     Date: 2018-07-31

[Accepted as a DR at the February, 2019 meeting.]

According to 7.5.4.3 [expr.prim.id.qual] paragraph 5,

In a qualified-id, if the unqualified-id is a conversion-function-id, its conversion-type-id shall denote the same type in both the context in which the entire qualified-id occurs and in the context of the class denoted by the nested-name-specifier.

However, _N4868_.6.5.6 [basic.lookup.classref] paragraph 7 says,

If the id-expression is a conversion-function-id, its conversion-type-id is first looked up in the class of the object expression and the name, if found, is used. Otherwise it is looked up in the context of the entire postfix-expression. In each of these lookups, only names that denote types or templates whose specializations are types are considered.

The latter was changed by issue 1111. It seems the former may have been overlooked in that change.

Proposed resolution (February, 2019):

Change 7.5.4.3 [expr.prim.id.qual] paragraph 4 as follows:

In a qualified-id, if the unqualified-id is a conversion-function-id, its conversion-type-id shall denote the same type in both the context in which the entire qualified-id occurs and in the context of the class denoted by the nested-name-specifier is first looked up in the class denoted by the nested-name-specifier of the qualified-id and the name, if found, is used. Otherwise, it is looked up in the context in which the entire qualified-id occurs. In each of these lookups, only names that denote types or templates whose specializations are types are considered.