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

2024-10-26


1220. Looking up conversion-type-ids

Section: _N4868_.6.5.6  [basic.lookup.classref]     Status: C++11     Submitter: Mike Miller     Date: 2010-11-13

[Voted into the WP at the March, 2011 meeting as part of paper N3262.]

The resolution of issue 1111 changes _N4868_.6.5.6 [basic.lookup.classref] paragraph 7 to read,

[A] conversion-type-id is first looked up in the class of the object expression and the name, if found and denotes a type, is used. Otherwise it is looked up in the context of the entire postfix-expression and the name shall denote a type.

The result of this specification is that a non-type member declaration in the class scope of the object expression will not be found (although it will hide a base class type member of the same name), but a non-type declaration in the context of the expression will be found (and make the program ill-formed).

This is inconsistent with the way other lookups are handled when they occur in a context that requires a type. For example, the lookup for a nested-name-specifier “considers only namespaces, types, and templates whose specializations are types” (6.5.5 [basic.lookup.qual] paragraph 1); the lookup for a name appearing in an elaborated-type-specifier is done “ignoring any non-type names that have been declared” (6.5.6 [basic.lookup.elab] paragraph 2); and in the lookup for a name in a base-type-specifier, “non-type names are ignored” (11.7 [class.derived] paragraph 2). The lookup for a conversion-type-id should be similar, and the wording in _N4868_.6.5.6 [basic.lookup.classref] paragraph 7 adjusted accordingly.