This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/10481: [3.3?/3.4 regression] Invalid use of non-static data member causes ICE.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]