Closed xmh0511 closed 9 months ago
Full name of submitter (unless configured in github; will be published with the issue): Jim X
[over.match.funcs.general] p4 says:
For implicit object member functions, the type of the implicit object parameter is [...] where X is the class of which the function is a member and cv is the cv-qualification on the member function declaration.
For implicit object member functions, the type of the implicit object parameter is
[...]
where X is the class of which the function is a member and cv is the cv-qualification on the member function declaration.
However, [class.derived.general] p2 says:
Members of a base class are also members of the derived class.
Consider this example:
struct Base{ void show(){} }; struct S:Base{ }; int main(){ S{}.show(); }
What's the type of the implicit parameter object of show in this case? According to the current wording, X is S because show is the member of S.
show
X
S
We may want to say
where X is the class in which the function is introduced by the member declaration
CWG2762
Full name of submitter (unless configured in github; will be published with the issue): Jim X
[over.match.funcs.general] p4 says:
However, [class.derived.general] p2 says:
Consider this example:
What's the type of the implicit parameter object of
show
in this case? According to the current wording,X
isS
becauseshow
is the member ofS
.Suggested Resolution
We may want to say