https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82417

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Thinking about this further, I think we must not include <complex.h> at all for
strict -std=c++1* modes, because users could have defined their own macros with
those names, but the C header #undefs them and then redefines them with
different meaning:

#define I 1
#define imaginary imag
#include <complex.h>
std::complex<double> n{0, I};
double zero = n.imaginary();

This explodes horribly.

We can't just #undef the names after including <complex.h> because the user
macros will already have been trashed by then.

Reply via email to