[PATCH] PR libstdc++/61761 fix std::proj for targets without C99 cproj

Szabolcs Nagy Szabolcs.Nagy@arm.com
Fri May 3 14:34:00 GMT 2019


On 03/05/2019 13:08, Jonathan Wakely wrote:
> On 03/05/19 11:21 +0000, Szabolcs Nagy wrote:
>> On 03/05/2019 12:16, Jonathan Wakely wrote:
>>> Hmm, which file in the source tree does the include/cmath symlink in
>>> the build tree point to?
>>
>> /work/b/build-aarch64-none-elf/obj/gcc2/aarch64-none-elf/libstdc++-v3$ ls -l include/cmath
>> lrwxrwxrwx 1 szabolcs szabolcs 51 May  1 18:06 include/cmath -> /work/b/src/gcc/libstdc++-v3/include/c_global/cmath
> 
> 
> Oh, I see the problem. <complex> and <cmath> both guard use of
> copysign by _GLIBCXX_USE_C99_MATH_TR1 but the test just uses it
> unconditionally.
> 
> Does the attached patch work?

it fails because copysign takes two arguments,
once that is fixed the test compiles.
thanks.

there is still an execution failure, but that's not
related to copysign: proj(i*inf) returns i*inf instead of inf
i haven't figured out why:

/work/b/src/gcc/libstdc++-v3/testsuite/26_numerics/complex/proj.cc:105: void test01(): Assertion 'eq( std::proj(c0p) ,
std::complex<double>(pinf, +0.0) )' failed.
FAIL: 26_numerics/complex/proj.cc execution test



More information about the Libstdc++ mailing list