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 parsing malformed code


Hi,

Compiling the following malformed code gives an ICE:


template<class T> class A
{
    virtual T operator()(const T& t) = 0;
};

void f() // note the missing semicolon

class B : public A<double>
{
    double operator()(const double& x) {return 2*x;}
};

int main()
{
  B b;
}


wsbob:/users/wsbob_4/ocs/pbienst/bug/ice$gcc -v
Reading specs from
/users/wsbob_4/ocs/pbienst/bin/gnu/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/
specs
gcc version 2.95.1 19990816 (release)


wsbob:/users/wsbob_4/ocs/pbienst/bug/ice$g++ bug.cpp
bug.cpp:4: warning: all member functions in class `A<T>' are private
bug.cpp: In function `void f()':
bug.cpp:8: parse error before `:'
bug.cpp: In function `int main()':
bug.cpp:15: Internal compiler error in `find_function_data', at
function.c:542
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]