`std::cosf`, `std::sinf`, `std::sqrtf` are not declared in `<cmath>`
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc |
Fix Released
|
Medium
|
|||
gcc-8 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
The following program fails to compile, even with `g++ --std=c++17 test.cpp`.
```
#include <cmath>
#include <stdio.h>
int main()
{
printf("%f\n", std::cosf(0.0f));
}
```
`std::cosf` is required by the c++ standard. Draft N4659, page 1140.
g++ version is 8.3.0-6ubuntu1
ProblemType: Bug
DistroRelease: Ubuntu 19.04
Package: libstdc++-8-dev 8.3.0-6ubuntu1
ProcVersionSign
Uname: Linux 5.0.0-15-generic x86_64
ApportVersion: 2.20.10-0ubuntu27
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Sun Jun 2 15:05:25 2019
InstallationDate: Installed on 2019-06-01 (0 days ago)
InstallationMedia: Ubuntu 18.04.2 LTS "Bionic Beaver" - Release amd64 (20190210)
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: gcc-8
UpgradeStatus: Upgraded to disco on 2019-06-01 (0 days ago)
Changed in gcc: | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
Changed in gcc: | |
status: | Confirmed → Fix Released |
#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)