From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17929 invoked by alias); 21 Aug 2002 09:06:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17910 invoked by uid 71); 21 Aug 2002 09:06:02 -0000 Resent-Date: 21 Aug 2002 09:06:02 -0000 Resent-Message-ID: <20020821090602.17909.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, ulrich.lauther@mchp.siemens.de Received: (qmail 16921 invoked by uid 61); 21 Aug 2002 09:00:45 -0000 Message-Id: <20020821090045.16920.qmail@sources.redhat.com> Date: Wed, 21 Aug 2002 03:06:00 -0000 From: ulrich.lauther@mchp.siemens.de Reply-To: ulrich.lauther@mchp.siemens.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/7674: unjustified syntax error when a class contains a reference AND a pointer to member X-SW-Source: 2002-08/txt/msg00438.txt.bz2 List-Id: >Number: 7674 >Category: c++ >Synopsis: unjustified syntax error when a class contains a reference AND a pointer to member >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Wed Aug 21 02:06:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Ulrich Lauther >Release: Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs Configured with: /usr/local/src/gcc-3.2/configure --enable-languages=c,c++ Thread model: posix gcc version 3.2 >Organization: >Environment: Linux i686, kernel 2.4.5 >Description: The code attached compiled with g++ bug.C gives: bug.C: In function `int main()': bug.C:23: uninitialized const member `components::m_g' >How-To-Repeat: g++ bug.C Where bug.C contains: class hgraph_base { public: int foo; }; class Hnode; class components { hgraph_base& m_g; int Hnode::* m_node_nr; public: inline components(hgraph_base& pg) : m_g (pg) { } }; int main () { hgraph_base base; components bi(base); return 0; } >Fix: change hgraph_base& into hgraph_base* (and adapt the rest of the program) or comment out the line int Hnode::* m_node_nr; (this is - of course - not really a fix, but might hint at the problem) >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="bug.C" Content-Disposition: inline; filename="bug.C" class hgraph_base { public: int foo; }; class Hnode; class components { hgraph_base& m_g; int Hnode::* m_node_nr; public: inline components(hgraph_base& pg) : m_g (pg) { } }; int main () { hgraph_base base; components bi(base); return 0; }