S
Stefan Ram
Was there a change in C++ or are the compilers broken?
For the source code
#include <iostream>
#include <ostream>
#include <cmath>
int main(){ ::std::cout << ::std::cos( 1 )<< '\n'; }
, I expect an error message, since it is not possible to tell
which overload of »::std::cos« (double, float, or long double)
is to be used. But instead, all compilers I tried gave me no
error message, no warning and execute the code as if I had
written »::std::cos( 1. )«.
For the source code
#include <iostream>
#include <ostream>
#include <cmath>
int main(){ ::std::cout << ::std::cos( 1 )<< '\n'; }
, I expect an error message, since it is not possible to tell
which overload of »::std::cos« (double, float, or long double)
is to be used. But instead, all compilers I tried gave me no
error message, no warning and execute the code as if I had
written »::std::cos( 1. )«.