From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21289 invoked by alias); 17 Oct 2008 08:54:13 -0000 Received: (qmail 20891 invoked by uid 48); 17 Oct 2008 08:52:53 -0000 Date: Fri, 17 Oct 2008 08:54:00 -0000 Subject: [Bug c++/37862] New: Parenthesised indirection alters class member access X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "nickc at redhat dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-10/txt/msg01142.txt.bz2 Hi Guys, Compiling and then executing this program: #include 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