pgc++ fails to compile code which uses std::isnan

When I try to compile the following code with pgc++:

#include <cmath>

int main()
{
        double val = 0.0;
        std::isnan(val);
        return 0;
}

I get

pgc++ -o pgi_test pgi_test.cpp
“/usr/include/c++/4.3/cmath”, line 540: error: identifier “__builtin_isnan” is
undefined
return __builtin_isnan(__type(__f));
^
detected during instantiation of
“__gnu_cxx::__enable_if<std::__is_arithmetic<_Tp>::__value,
int>::__type std::isnan(_Tp) [with _Tp=double]” at line 6
of “pgi_test.cpp”

1 error detected in the compilation of “pgi_test.cpp”.

Is this an issue with my installation or an issue with pgc++? Is there a possible workaround?

pgc++ is pgc++ 13.6-0 64-bit target on x86-64 Linux -tp nehalem
g++ is g++ (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973][/code]

Hi jirikraus,

Thanks for the report. This is actually a known issue but hasn’t been fixed in an external release as of yet. To track, I added TPR#19468. Hopefully since it’s been addressed internally, we can get the updates into the next external release (13.9).

As a work-around till then, remove “std::” from “isnan”.

Best Regards,
Mat

Thanks for the simple workaround. Jiri