public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Shadow data member
       [not found] <1375308083.211659.1632947600348.ref@mail.yahoo.com>
@ 2021-09-29 20:33 ` Nick Savoiu
  2021-09-29 20:35   ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Savoiu @ 2021-09-29 20:33 UTC (permalink / raw)
  To: gcc

Should GCC report shadowing on 'valid' for this code?
Nick

struct S1{    bool valid;};
struct S2 : public S1{    bool valid;};
struct S3 : public S2{    bool valid;};

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

* Re: Shadow data member
  2021-09-29 20:33 ` Shadow data member Nick Savoiu
@ 2021-09-29 20:35   ` Jonathan Wakely
  2021-09-29 20:37     ` Nick Savoiu
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2021-09-29 20:35 UTC (permalink / raw)
  To: Nick Savoiu; +Cc: gcc

On Wed, 29 Sept 2021 at 21:34, Nick Savoiu via Gcc <gcc@gcc.gnu.org> wrote:
>
> Should GCC report shadowing on 'valid' for this code?
> Nick
>
> struct S1{    bool valid;};
> struct S2 : public S1{    bool valid;};
> struct S3 : public S2{    bool valid;};

This question belongs on the gcc-help list, not here.

IMHO, this is name hiding, now shadowing.

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

* Re: Shadow data member
  2021-09-29 20:35   ` Jonathan Wakely
@ 2021-09-29 20:37     ` Nick Savoiu
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Savoiu @ 2021-09-29 20:37 UTC (permalink / raw)
  To: jwakely.gcc; +Cc: gcc

Ok, sorry. I'll ask it on gcc-help.
Nick
 
 
  On Wed, Sep 29, 2021 at 1:35 PM, Jonathan Wakely<jwakely.gcc@gmail.com> wrote:   On Wed, 29 Sept 2021 at 21:34, Nick Savoiu via Gcc <gcc@gcc.gnu.org> wrote:
>
> Should GCC report shadowing on 'valid' for this code?
> Nick
>
> struct S1{    bool valid;};
> struct S2 : public S1{    bool valid;};
> struct S3 : public S2{    bool valid;};

This question belongs on the gcc-help list, not here.

IMHO, this is name hiding, now shadowing.
  

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

end of thread, other threads:[~2021-09-29 20:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1375308083.211659.1632947600348.ref@mail.yahoo.com>
2021-09-29 20:33 ` Shadow data member Nick Savoiu
2021-09-29 20:35   ` Jonathan Wakely
2021-09-29 20:37     ` Nick Savoiu

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