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]

Re: ICE


Thomas Matelich <sosedada@usa.net> writes:
> typedef.cc:
> ---------------
> #include <complex>
> 
> typedef std::complex<double> complex;
> 
> int main()
> {
>    complex x;
> 
>    x += 1;
> 
>    return 0;
> }
> tom> g++ -v -fhonor-std typedef_std.cc

Note that gcc-2.95 will report, using -fhonor-std:

  typedef-bug1.cc:3: syntax error before `;'
  typedef-bug1.cc: In function `int main()':
  typedef-bug1.cc:7: `complex' undeclared (first use this function)
  typedef-bug1.cc:7: (Each undeclared identifier is reported only once
  typedef-bug1.cc:7: for each function it appears in.)
  typedef-bug1.cc:7: parse error before `;'
  typedef-bug1.cc:9: `x' undeclared (first use this function)

unless you wrap `#include <complex>' in the std namespace. Until the new
standard compliant C++ library[1] is released, I'm afraid it'll remain
that way when you -fhonor-std.

The compiler bug is fixed in upcoming gcc-2.95. The library limitation is
a another issue.

[1] See http://sourceware.cygnus.com/libstdc++/

Regards,
Mumit


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