This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Enum in namespace


Hi!

namespace A {
	enum A {
	        x
	};
}

void f()
{
        A::A a;
        using namespace A;
        a = x;
}

works whereas

namespace A {
	enum A {
	        x
	};
}

void f()
{
        using namespace A;
        A::A a;
        a = x;
}

gives the following error:

test.cc: In function 'void f()':
test.cc:10: error: reference to 'A' is ambiguous
test.cc:1: error: candidates are: namespace A { }
test.cc:2: error:                 enum A::A

Since A::A is fully qualified it should be clear that the first A is the namespace and the second the enum.
Is this a bug or am I too demanding?


Thanks,

G


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]