Bug 79700 - std::fabsf and std::fabsl missing from <cmath>
Summary: std::fabsf and std::fabsl missing from <cmath>
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 6.3.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
: 89279 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-02-24 02:31 UTC by Jonathan Wakely
Modified: 2019-09-05 14:47 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2017-02-24 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Wakely 2017-02-24 02:31:50 UTC
#include <cmath>

using std::fabsf;
using std::fabsl;

abs.cc:3:12: error: ‘std::fabsf’ has not been declared
 using std::fabsf;
            ^~~~~
abs.cc:4:12: error: ‘std::fabsl’ has not been declared
 using std::fabsl;
            ^~~~~

These are required by C++17 (and maybe implicitly by C++11, although it's not very clear)
Comment 1 Jonathan Wakely 2017-02-24 02:50:32 UTC
Also:

modf{f,l}
acos{f,l}
asin{f,l}
atan2{f,l}
cos{f,l}
sin{f,l}
tan{f,l}
cosh{f,l}
sinh{f,l}
tanh{f,l}
exp{f,l}
frexp{f,l}
ldexp{f,l}
log{f,l}
log10{f,l}
pow{f,l}
sqrt{f,l}
ceil{f,l}
floor{f,l}
fmod{f,l}
Comment 2 Jonathan Wakely 2019-02-11 10:16:59 UTC
*** Bug 89279 has been marked as a duplicate of this bug. ***
Comment 3 JMB 2019-09-05 14:18:28 UTC
The bug is still present with g++ 8.3.0 on Ubuntu 19.04
(g++ (Ubuntu 8.3.0-6ubuntu1) 8.3.0) as tested with sqrtl.
As g++ is not conformant with c++11 (AFAIK):
  std::sqrt(n)
will result in the error message:
  error: ‘sqrtl’ is not a member of ‘std’
while using '# include <ctime>',
this bug should be fixed.
Otherwise please give a short comment to this bug report explaining why this can  not or should not be fixed.
Especially if giving C++14 as default ...
Comment 4 Jonathan Wakely 2019-09-05 14:47:40 UTC
(In reply to JMB from comment #3)
> this bug should be fixed.

Yes, we know. That's why there's a bug report.

> Otherwise please give a short comment to this bug report explaining why this
> can  not or should not be fixed.

Of course it should be fixed, that's why there's a bug report and it hasn't been closed. But we have lots of bugs and finite resources.

> Especially if giving C++14 as default ...

As I said above, it's not actually clear if this is required by C++11 and C++14. The function sqrtl is not mentioned at all in the C++14 standard. It's definitely required by C++17, but that isn't enabled by default.