This code was obtained from the example in §3.3.7/1.5:
enum { i = 1 };
class X {
char v[i]; // error: i refers to ::i
// but when reevaluated is X::i
enum { i = 2 };
};
GCC emits an error because of §3.3.7/1.2
However, if we apply §3.4.1/7, the lookup for the name i
in the declaration char v[i];
will find enum{ i = 1 };
in global scope. What's the problem with the redeclaration enum{ i = 2 };
?