On my GCC, using the GNU C library (glibc), I can work around by dropping out of std::
into the global namespace, changing
return std::floorf(x * float(m) + q);
to
return ::floorf(x * float(m) + q);
The workaround works because floorf()
belongs to the C standard library, so it has a global symbol in glibc. Since the workaround uses the global symbol, which C++11 allows but does not require to exist, the workaround is nonportable. Nevertheless, for glibc, it appears to work.
The workaround could be made portable, if you wish, by changing #include <cmath>
to #include <math.h>
and (as far as I know) dropping all your C-math-library calls into the global namespace. It would still be just a workaround, though.
You may go ahead and report this as a bug at: GCC Bugzilla Main Page. Moreover, to be taken more seriously by the GCC team, you can link the bug report back here to show that several competent pairs of eyes have already looked at the problem. Meanwhile, nice work.