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

2024-03-20


1764. Hiding of function from using-declaration by signature

Section: 6.5.2  [class.member.lookup]     Status: C++14     Submitter: Canada     Date: 2013-09-23

N3690 comment CA 6

[Moved to DR at the February, 2014 meeting.]

According to 9.9 [namespace.udecl] paragraph 15,

When a using-declaration brings names from a base class into a derived class scope, member functions and member function templates in the derived class override and/or hide member functions and member function templates with the same name, parameter-type-list (9.3.4.6 [dcl.fct]), cv-qualification, and ref-qualifier (if any) in a base class (rather than conflicting).

The algorithm for class-scope name lookup given in 6.5.2 [class.member.lookup], however, does not implement this requirement; there is nothing that removes a hidden base class member (replacing the using-declaration, per paragraph 3) from the result set.

Proposed resolution (September, 2013):

Change 6.5.2 [class.member.lookup] paragraph 3 as follows:

The lookup set for f in C, called S(f, C), consists of two component sets: the declaration set, a set of members named f; and the subobject set, a set of subobjects where declarations of these members (possibly including using-declarations) were found. In the declaration set, using-declarations are replaced by the members they designate set of designated members that are not hidden or overridden by members of the derived class (9.9 [namespace.udecl]), and type declarations (including injected-class-names) are replaced by the types they designate...