namespace ns1 { void foo(int){} namespace ns2 { void foo(){} void test() { //using ns1::foo; foo(42); } } // namespace ns2 } // namespace ns1 int main() { }
Standard input is empty
prog.cpp: In function ‘void ns1::ns2::test()’: prog.cpp:15:8: error: too many arguments to function ‘void ns1::ns2::foo()’ foo(42); ^ prog.cpp:10:6: note: declared here void foo(){} ^~~
Standard output is empty