[C++11] a question involving forward declarations for enums

Platform: linux, x86_64, clang++3.2, g++4.7.2

See the following code:

I agree; neither compiler is correct here.

John.

Class types have the same rule (see [class]p11) and we don’t enforce that either. For instance:

namespace M {
namespace N {
struct S;
}
using N::S;
}
struct M::S { };
M::S m; // error, ambiguous

FWIW, g++ accepts both of these (even with -pedantic) and EDG accepts both outside its strict mode.