#include <iostream>
#include <cmath>
using namespace std;
namespace Sibling1 {
float cos(float x) { return cosf(x); }
}
namespace Sibling2 {
using namespace Sibling1;
float f(float x) { return cos(x); }
}
int main() {
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cm5hbWVzcGFjZSBTaWJsaW5nMSB7CiAgZmxvYXQgY29zKGZsb2F0IHgpIHsgcmV0dXJuIGNvc2YoeCk7IH0KfQpuYW1lc3BhY2UgU2libGluZzIgewogIHVzaW5nIG5hbWVzcGFjZSBTaWJsaW5nMTsKICBmbG9hdCBmKGZsb2F0IHgpIHsgcmV0dXJuIGNvcyh4KTsgfQp9CmludCBtYWluKCkgewp9
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));
^~~~~~~~~~~~~~