fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. namespace Sibling1 {
  5. float cos(float x) { return cosf(x); }
  6. }
  7. namespace Sibling2 {
  8. using namespace Sibling1;
  9. float f(float x) { return cos(x); }
  10. }
  11. int main() {
  12. }
Compilation error #stdin compilation error #stdout 0s 4372KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘float Sibling2::f(float)’:
prog.cpp:9:34: error: call of overloaded ‘cos(float&)’ is ambiguous
   float f(float x) { return cos(x); }
                                  ^
prog.cpp:5:9: note: candidate: ‘float Sibling1::cos(float)’
   float cos(float x) { return cosf(x); }
         ^~~
In file included from prog.cpp:2:
/usr/include/c++/8/cmath:184:3: note: candidate: ‘constexpr float std::cos(float)’
   cos(float __x)
   ^~~
/usr/include/c++/8/cmath:188:3: note: candidate: ‘constexpr long double std::cos(long double)’
   cos(long double __x)
   ^~~
In file included from /usr/include/features.h:446,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/8/bits/c++config.h:508,
                 from /usr/include/c++/8/iostream:38,
                 from prog.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:62:1: note: candidate: ‘double cos(double)’
 __MATHCALL_VEC (cos,, (_Mdouble_ __x));
 ^~~~~~~~~~~~~~
stdout
Standard output is empty