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]

ICE on undefined identifiers


Hi,

The following file with lots of undefined identifiers crashes the compiler:

wsbob:/users/wsbob_4/ocs/pbienst/camfr2$more bug.cpp
#include <vector>

struct Term;

struct Expression
{
    Term* get_term(int i) {return terms[i];}
    vector<Term*> terms;
};

struct Term
{
    Term(D& d_); // 'D' undefined
    D* d;
};

Term::Term(D& d_) : d(&d_) {}

ostream& operator<<(ostream& s, Expression& e)
{
  for (unsigned int i=0; i<2; i++)
    cout << e.get_term(i)->type << endl; // 'type' undefined
}


wsbob:/users/wsbob_4/ocs/pbienst/camfr2$gcc -v
Reading specs from
/users/wsbob_4/ocs/pbienst/bin/gnu/lib/gcc-lib/sparc-sun-solaris
2.6/2.96/specs
gcc version 2.96 19991110 (experimental)


wsbob:/users/wsbob_4/ocs/pbienst/camfr2$g++ bug.cpp
bug.cpp:13: parse error before `&'
bug.cpp:14: syntax error before `*'
bug.cpp:17: parse error before `&'
bug.cpp: In function `ostream &operator << (ostream &, Expression &)':
bug.cpp:22: `struct Term' has no member named `type'
bug.cpp:21: Internal compiler error in `expand_expr', at expr.c:5864
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for
instructions.

-------------------------------------
Peter Bienstman
Department of Information Technology
INTEC/IMEC - University of Gent
St.-Pietersnieuwstraat 41
B-9000 Gent - Belgium
E-mail: Peter.Bienstman@rug.ac.be
Tel: +32 9 264 3445
Fax: +32 9 264 3593
-------------------------------------


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