Title
Looking up conversion-type-ids
Status
c++11
Section
_N4868_.6.5.6 [basic.lookup.classref]
Submitter
Mike Miller

Created on 2010-11-13.00:00:00 last changed 96 months ago

Messages

Date: 2011-03-15.00:00:00

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

Date: 2021-02-24.00:00:00

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.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetmessages: + msg3296
2011-04-10 00:00:00adminsetstatus: drafting -> fdis
2010-11-13 00:00:00admincreate