Comeau online compiler and std::sqrt
I would like an opinion concerning this program:
Code:
#include <cmath>
int main()
{
double x = 0.0;
x = std::sqrt(x);
}
The MinGW port of g++ 3.4.5 finds no fault with the above program. The Comeau online compiler, on the other hand, fails to compile it, citing this error:
Code:
MODE:strict errors C++ C++0x_extensions
"ComeauTest.c", line 6: error: more than one instance of overloaded function
"std::sqrt" matches the argument list, the choices that match are:
function "std::sqrt(float)"
function "std::sqrt(long double)"
The argument types that you used are: (double)
x = std::sqrt(x);
^
1 error detected in the compilation of "ComeauTest.c".
Checking the C++ Standard, I see:
Quote:
Originally Posted by C++03 Section 26.5 Paragraph 5
In addition to the double versions of the math functions in <cmath>, C++ adds float and long double overloaded versions of these functions, with the same semantics.
I conclude then that the error is due to a missing double sqrt(double) version of std::sqrt, and thus is a bug in the standard library implementation used by the Comeau online compiler. Am I correct?