c++/958: ice #123 in pop_binding_level, at cp/decl.c:609

schmid@snake.iap.physik.tu-darmstadt.de schmid@snake.iap.physik.tu-darmstadt.de
Fri Dec 1 16:06:00 GMT 2000


>Number:         958
>Category:       c++
>Synopsis:       ice #123 in pop_binding_level, at cp/decl.c:609
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 01 16:06:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Peter Schmid
>Release:        2.97 20001120 (experimental)
>Organization:
TU Darmstadt
>Environment:
System: Linux kiste 2.4.0-test10 #20 Thu Nov 2 03:02:57 CET 2000 i686 unknown
Architecture: i686
GNU assembler 001002
GLIBC 2.1.3
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: ../gcc-20001120/configure -enable-shared --disable-nls --enable-threads=posix --enable-long-long --enable-libstdcxx-v3
gcc version 2.97 20001120 (experimental)
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-20001120/configure -enable-shared --disable-nls --enable-threads=posix --enable-long-long --enable-libstdcxx-v3
>Description:
The following buggy code crashes the compiler with an internal
compiler error. 


>How-To-Repeat:
Source file te.C:x
class A : public E     
{
public:
    A(D *d=0);
    void g(); 
private:
    B *b;            
};


A::A(D *d) : E()
{
  b = new B;  
  z(h(const B &));
} 

void A::g()
{
}

Compiling the program:
g++ -c te.C -save-temps
te.C:2: parse error before '{' token
te.C:6: parse error before 'CPP_NAME' token
te.C:11: `D' was not declared in this scope
te.C:11: `d' was not declared in this scope
te.C:11: structure `A' not yet defined
te.C:11: invalid declarator
te.C:11: syntax error before ':' token
te.C:14: parse error before '&' token
te.C:14: ISO C++ forbids declaration of `z' with no type
te.C: In function `int z(...)':
te.C:18: invalid use of undefined type `class A'
te.C:1: forward declaration of `class A'
te.C: In member function `void A::g()':
te.C:19: Internal error #123.
te.C:19: Internal compiler error in pop_binding_level, at cp/decl.c:609
confused by earlier errors, bailing out

preprocessor source: te.ii

# 1 "te.C"
class A : public E
{
public:
    A(D *d=0);
    void g();
private:
    B *b;
};


A::A(D *d) : E()
{
  b = new B;
  z(h(const B &));
}

void A::g()
{
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the Gcc-bugs mailing list