http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54112

--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> 2012-07-28 10:26:42 
UTC ---
(In reply to comment #1)
> Why it happens only in C++03 mode?

Because the complex.h wrapper distributed with libstdc++ does:

#ifdef __GXX_EXPERIMENTAL_CXX0X__
# include <ccomplex>
#else
# if _GLIBCXX_HAVE_COMPLEX_H
#  include_next <complex.h>
# endif
#endif

That's what I meant by "hijack", the system's complex.h can never be included
in C++11.

> I'm asking because if the issue isn't a
> regression and we are sure that it doesn't happen in C++11 mode, I don't think
> it can be considered high priority.

I am not saying it is high priority (on the other hand, it is rather easy).
Note that there are 2 issues (I should have been clearer):

1) we can't include both complex.h and complex in C++03 mode. The fix is
trivial, #undef complex after the #include_next quoted above. The other headers
all have a long list of #undef, that's just one more.

2) In C++11, there is no way to have cacos declared. A solution would be to
move the _GLIBCXX_HAVE_COMPLEX_H block outside of the
__GXX_EXPERIMENTAL_CXX0X__ condition.

Reply via email to