You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
According to [basic.scope.scope] p4, which requires they have corresponding object parameters. Although, we have specified the type of implicit object parameter in [over.match.funcs.general] p4, that says
For conversion functions that are implicit object member functions, the function is considered to be a member of the class of the implied object argument for the purpose of defining the type of the implicit object parameter. For non-conversion functions that are implicit object member functions nominated by a using-declaration in a derived class, the function is considered to be a member of the derived class for the purpose of defining the type of the implicit object parameter.
However, such a source transformation and construction are only used in overload resolution, as per [over.match.funcs.general] p1
The source transformations and constructions defined in these subclauses are only for the purpose of describing the overload resolution process.
Consider this example:
structBase{
voidshow(int);
};
structDerived:Base{
using Base::show;
voidshow(int);
};
How to consider the properties of the object parameter of B::show in this context? Maybe, we should append the following rule
consider the member functions and member function templates of the base class are members of the derived class if the members have implicit object parameters.
The determination of the type of an implicit object parameter should be moved from [over] as a common rule?
whether the constructors have object parameters when comparing whether they correspond?
[dcl.fct] p8 says
The object parameter of a non-static member function is either the explicit object parameter or the implicit object parameter ([over.match.funcs]).
A constructor is a non-static member function, the rule says a constructor should have an object parameter. Although, [over.match.funcs.general] p2 says
For the purposes of overload resolution, both static and non-static member functions have an object parameter, but constructors do not.
Again, the rule is just applied in the overload resolution. Consider this example:
structBase1{
Base1(int);
};
structDerived1:Base1{
using Base1::Base1;
Derived(int);
};
Is [namespace.udecl] p11 suitable for this case? Furthermore, Do such two constructors correspond?
The text was updated successfully, but these errors were encountered:
[namespace.udecl] p11 says
According to [basic.scope.scope] p4, which requires they have corresponding object parameters. Although, we have specified the type of implicit object parameter in [over.match.funcs.general] p4, that says
However, such a source transformation and construction are only used in overload resolution, as per [over.match.funcs.general] p1
Consider this example:
How to consider the properties of the object parameter of
B::show
in this context? Maybe, we should append the following ruleThe determination of the type of an implicit object parameter should be moved from [over] as a common rule?
whether the constructors have object parameters when comparing whether they correspond?
[dcl.fct] p8 says
A constructor is a non-static member function, the rule says a constructor should have an object parameter. Although, [over.match.funcs.general] p2 says
Again, the rule is just applied in the overload resolution. Consider this example:
Is [namespace.udecl] p11 suitable for this case? Furthermore, Do such two constructors correspond?
The text was updated successfully, but these errors were encountered: