B
Boris
Is this a valid C++ program (according to the C++ standard)? I ask as I'm
trying to port a Windows library to Solaris, and the Solaris C++ compiler
reports an error (The name x is ambiguous in ns1: ns2::x and ns1::x). The
code below reproduces the problem, and I wonder now if I have to adapt the
code or submit a bug report to Sun?
namespace ns1 {
struct x { };
}
namespace ns2 {
using namespace ns1; // If this line is removed ...
void x(); // ... or this line the code compiles.
struct x { };
}
int main()
{
struct ns2::x x;
}
trying to port a Windows library to Solaris, and the Solaris C++ compiler
reports an error (The name x is ambiguous in ns1: ns2::x and ns1::x). The
code below reproduces the problem, and I wonder now if I have to adapt the
code or submit a bug report to Sun?
namespace ns1 {
struct x { };
}
namespace ns2 {
using namespace ns1; // If this line is removed ...
void x(); // ... or this line the code compiles.
struct x { };
}
int main()
{
struct ns2::x x;
}