This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/54112] New: including complex.h and complex fails in C++03
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 28 Jul 2012 07:56:48 +0000
- Subject: [Bug libstdc++/54112] New: including complex.h and complex fails in C++03
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54112
Bug #: 54112
Summary: including complex.h and complex fails in C++03
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: glisse@gcc.gnu.org
#include <complex.h>
#ifdef FIX
#undef complex
#endif
#include <complex>
fails to compile with glibc. Since libstdc++ already installs a complex.h
wrapper that #include_next complex.h, I guess it could easily #undef complex
afterwards.
Note that you can include tr1/complex instead of complex if you prefer.
I guess I could also ask glibc to protect their #define with #ifndef
__cplusplus.
It is strange that in C++11 it is impossible to have access to the C99
functions cacos and others, since C++11 hijacks their header. g++ accepts
_Complex, I expect we should still have access to those functions.