]> git.ipfire.org Git - thirdparty/gcc.git/commit - libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.h
PR libstdc++/82417 do not include C99 <complex.h> in strict modes
authorJonathan Wakely <jwakely@redhat.com>
Tue, 10 Oct 2017 11:25:45 +0000 (12:25 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 10 Oct 2017 11:25:45 +0000 (12:25 +0100)
commit5d2b8075260770dd213dbbffed5541c2594e3d81
tree98170b46edf170d15a8630cb132720b144d7ad4b
parentefe040bf219da9f0aa2298c19909e392c784b3d3
PR libstdc++/82417 do not include C99 <complex.h> in strict modes

As an extension the C++ version of <complex.h> includes the C version,
but that defines macros with non-reserved names that should not be
defined in ISO C++. Only include the C header for non-strict modes, or
for pre-C++11 (because C++98 doesn't mention <complex.h> at all).

PR libstdc++/59087
PR libstdc++/82417
* include/c_compatibility/complex.h [!C++98 && __STRICT_ANSI__]: Do
not include C library's <complex.h>.
* testsuite/26_numerics/complex/c99.cc: Depend on __STRICT_ANSI__.
* testsuite/26_numerics/headers/complex.h/std_c++11.h: New test.
* testsuite/26_numerics/headers/complex.h/std_gnu++11.h: New test.
* testsuite/26_numerics/headers/complex.h/std_c++98.h: New test.

From-SVN: r253581
libstdc++-v3/ChangeLog
libstdc++-v3/include/c_compatibility/complex.h
libstdc++-v3/testsuite/26_numerics/complex/c99.cc
libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.h [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.h [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.h [new file with mode: 0644]