compiler error 980715

Thomas Matelich tmatelich@zetec.com
Wed Sep 23 15:16:00 GMT 1998


I was messing around with implicit_cast (C++ Programming Language,
13.3.2) and got this error.  I worked around it with copy and a warning,
but it said to send a message.

I am using the 1.1 release.

Here is the boiled down offending source code:

     #include <iostream.h>
     #include <vector>

     template < class T, class U > T implicit_cast(const U& u) { return
     u; }

     int main()
     {
        vector<double> source(20);
        for (int i = 0; i < 20; i++)
           source[i] = 2*i/3;

        vector<short> dest(20);

        transform(source.begin(), source.end(), dest.begin(),
                  implicit_cast<short, double>);

        return 0;
     }

And the result:

tom> g++ -v implicit_cast.cc
Reading specs from
/opt/gnu/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 /opt/gnu/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.91.57/cpp -lang-c++ -v
-undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91
-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix
-D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__PWB__
-D__hpux__ -D__unix__ -D__hppa -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux
-D__unix -Asystem(unix) -Asystem(hpux) -Acpu(hppa) -Amachine(hppa)
-D__EXCEPTIONS -D__hp9000s700 -D_PA_RISC1_1 -D_HPUX_SOURCE
-D_HIUX_SOURCE implicit_cast.cc /home/tom/local/tmp/cciunPrj.ii
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (hppa)
#include "..." search starts here:
#include <...> search starts here:
 /opt/gnu/include/g++
 /usr/local/include
 /opt/gnu/hppa1.1-hp-hpux10.20/include
 /opt/gnu/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.91.57/include
 /usr/include
End of search list.
 /opt/gnu/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.91.57/cc1plus
/home/tom/local/tmp/cciunPrj.ii -quiet -dumpbase implicit_cast.cc
-version -o /home/tom/local/tmp/cc1MCg9a.s
GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release)
(hppa1.1-hp-hpux10.20) compiled by GNU C version egcs-2.91.57 19980901
(egcs-1.1 release).
implicit_cast.cc: In function `int main()':
implicit_cast.cc:15: Internal compiler error 980715.
implicit_cast.cc:15: Please submit a full bug report to
`egcs-bugs@cygnus.com'.


--
Thomas O Matelich
Senior Programmer
Zetec, Inc.
tmatelich@zetec.com






More information about the Gcc-bugs mailing list