Request for review (M): 6778669: Patch from Red Hat -- fixes compilation errors
Paul Hohensee
Paul.Hohensee at Sun.COM
Thu Feb 26 07:25:12 PST 2009
I agree with Vladimir. C++ has a lot of implicit defaults, of which
this is one,
and all of which cause confusion. I like to mark every implicitly
virtual method
in subclasses with an explicit "virtual". Then I can understand the
cost of what
I'm doing without looking up the entire class hierarchy.
Paul
Vladimir Kozlov wrote:
> No, these 2 methods arguments are the same.
> I am not talking about renamed methods but these two:
>
> class MatchNode {
> virtual void append_components(FormDict& locals, ComponentList&
> components,
> bool def_flag = false) const;
> virtual bool equivalent(FormDict& globals, MatchNode* mNode2);
> }
>
> class MatchRule: public MatchNode {
> void append_components(FormDict& locals, ComponentList&
> components, bool def_flag = false) const;
> bool equivalent(FormDict& globals, MatchNode* mRule2);
> }
>
> In such situation C++ implicitly marks methods in MatchRule class as
> virtual also.
> And I only asked to specify 'virtual' explicitly for these two methods.
>
> Vladimir
>
> Christian Thalinger wrote:
>> On Wed, 2009-02-25 at 08:55 -0800, Vladimir Kozlov wrote:
>>> Looks good.
>>> In formssel.hpp I would mark MatchRule::append_components() and
>>> MatchRule::equivalent() as virtual also.
>>
>> I tried that but the arguments are different, so the subclass would
>> shadow the superclass' methods. I didn't find a solution.
>>
>> -- Christian
>>
More information about the hotspot-dev
mailing list