From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13852 invoked by alias); 24 Apr 2003 13:57:42 -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 13828 invoked by uid 48); 24 Apr 2003 13:57:41 -0000 Date: Thu, 24 Apr 2003 13:57:00 -0000 Message-ID: <20030424135741.13827.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, mmitchel@gcc.gnu.org, nobody@gcc.gnu.org, redi@gcc.gnu.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, mmitchel@gcc.gnu.org, nobody@gcc.gnu.org, redi@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/10481: [3.3?/3.4 regression] Invalid use of non-static data member causes ICE. X-SW-Source: 2003-04/txt/msg01037.txt.bz2 List-Id: Old Synopsis: Invalid use of non-static data member causes ICE. New Synopsis: [3.3?/3.4 regression] Invalid use of non-static data member causes ICE. Responsible-Changed-From-To: unassigned->mmitchel Responsible-Changed-By: bangerth Responsible-Changed-When: Thu Apr 24 13:57:41 2003 Responsible-Changed-Why: I think you worked in this area recently when you fixed this type `A' is not a base type for type `B' problem. State-Changed-From-To: open->analyzed State-Changed-By: bangerth State-Changed-When: Thu Apr 24 13:57:41 2003 State-Changed-Why: Confirmed. ------------------ struct A { char a; }; struct B { void f() { A::a; } }; --------------------- g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc x.cc: In member function `void B::f()': x.cc:7: internal compiler error: Segmentation fault I can't presently tell whether 3.3 ICEs, since my version is a couple of days old. I really should update... The error happens here: (gdb) bt #0 finish_non_static_data_member (decl=0x401a0654, qualifying_scope=0x401a03cc) at ../../gcc-3.4-CVS/gcc/cp/semantics.c:1219 #1 0x080fa827 in cp_parser_postfix_expression (parser=0x401a2f40, address_p=false) at ../../gcc-3.4-CVS/gcc/cp/parser.c:3824 #2 0x080fb050 in cp_parser_unary_expression (parser=0x401a2f40, address_p=false) at ../../gcc-3.4-CVS/gcc/cp/parser.c:4499 #3 0x080fb9fc in cp_parser_pm_expression (parser=0x401a2f40) at ../../gcc-3.4-CVS/gcc/cp/parser.c:4952 #4 0x08104c82 in cp_parser_binary_expression (parser=0x401a2f40, token_tree_map=0x8474fc0, fn=0x80fb9e0 ) at ../../gcc-3.4-CVS/gcc/cp/parser.c:13571 which is the inner while loop here: while (!DERIVED_FROM_P (context_for_name_lookup (decl), access_type)) { access_type = TYPE_CONTEXT (access_type); while (DECL_P (access_type)) access_type = DECL_CONTEXT (access_type); } It ICEs since access_type==0. This code hasn't been changed recently, just as the one one frame higher, so I can't pinpoint a certain patch. W. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10481