Skip to content

The range of the application of [namespace.udecl#11] #4590

Open
@xmh0511

Description

@xmh0511

The set of declarations named by a using-declarator that inhabits a class C does not include member functions and member function templates of a base class that correspond to (and thus would conflict with) a declaration of a function or function template in C.

See the following example

struct Base{
    static void fun(){}
};
struct D:Base{
    using Base::fun;
    // decltype(fun()) a;  //#1
    // static auto fun()->decltype(fun()){return 0;}  //#2
    static int fun(){
        return 0;
    }
    decltype(fun()) a;  //#3
};

#1 and #2 are both ill-formed considered by the major implementations. Instead, #3 is ok. It seems that the bullet [namespace.udecl#11] does not uniformly apply to any case. It appears to me that the declarations named by using-declaration are being hidden from the point P which is immediately after the locus of the declarations that is declared in C.

Should we say

After a point P, the set of declarations named by a using-declarator that inhabits a class C does not include member functions and member function templates of a base class that correspond to (and thus would conflict with) a declaration of a function or function template in C where P is immediately after the locus of the declaration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cwgIssue must be reviewed by CWG.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions