public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* valid code?
@ 2008-09-10  1:40 Mike Stump
  2008-09-10 10:26 ` Marco Manfredini
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Stump @ 2008-09-10  1:40 UTC (permalink / raw)
  To: gcc-help

So, was wondering, what do people think of:

class A {
   virtual int B() { return 0; }
};

class B: A {
   B() { }
};

valid code?  I didn't find any prohibitions against it (yet) in the 98  
language standard.  I'm kinda wishing there is and was hoping someone  
where could just cite it.  :-)  If not, I'll file a bug report for it.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: valid code?
  2008-09-10  1:40 valid code? Mike Stump
@ 2008-09-10 10:26 ` Marco Manfredini
  0 siblings, 0 replies; 2+ messages in thread
From: Marco Manfredini @ 2008-09-10 10:26 UTC (permalink / raw)
  To: gcc-help

On Wednesday 10 September 2008, Mike Stump wrote:
> So, was wondering, what do people think of:
>
> class A {
>    virtual int B() { return 0; }
> };
>
> class B: A {
>    B() { }
> };

I'd reckon that 3.3.7 "Name Hiding" is applicable here. The declaration of B 
introduces a name that hides int A::B(), changing it into a class name. 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-10 10:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-10  1:40 valid code? Mike Stump
2008-09-10 10:26 ` Marco Manfredini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).