Description
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.