public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/37862]  New: Parenthesised indirection alters class member access
@ 2008-10-17  8:54 nickc at redhat dot com
  2008-10-18 11:12 ` [Bug c++/37862] " rguenth at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: nickc at redhat dot com @ 2008-10-17  8:54 UTC (permalink / raw)
  To: gcc-bugs

Hi Guys,

Compiling and then executing this program:
#include <stdio.h>

class A {
public:
 virtual void get() { printf ("A\n"); }
};
class B:public A {
public:
 virtual void get() { printf ("B\n"); }
};
class C:public B {
};
int main (void)
{
 C c;
 C* p = &c;

 p->A::get();
 (p->A::get)();

 return 0;
}

Results in:

  A
  B

Being displayed, rather than:

  A
  A

As far as I can tell the parentheses around the class member access should not
change anything.

Cheers
  Nick


-- 
           Summary: Parenthesised indirection alters class member access
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nickc at redhat dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37862


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

end of thread, other threads:[~2009-02-10 23:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-17  8:54 [Bug c++/37862] New: Parenthesised indirection alters class member access nickc at redhat dot com
2008-10-18 11:12 ` [Bug c++/37862] " rguenth at gcc dot gnu dot org
2008-11-10 13:37 ` nickc at redhat dot com
2008-11-10 13:51 ` nickc at redhat dot com
2008-11-10 16:23 ` nickc at redhat dot com
2008-11-10 16:24 ` nickc at redhat dot com
2009-01-14 13:00 ` nickc at gcc dot gnu dot org
2009-02-10 23:11 ` jason at gcc dot gnu dot org

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