This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
enum scoping?
- To: gcc at gcc dot gnu dot org
- Subject: enum scoping?
- From: Sam Lantinga <slouken at devolution dot com>
- Date: Fri, 12 Oct 2001 19:48:27 -0700
The attached source code generates an error with gcc 3.01 and the
latest CVS code. My question is.. should it? Is it legal C++?
If it isn't, why does enabling the typedef enum portion fix the problem?
Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment
enum foo {
a,
};
namespace One {
enum foo {
b,
};
}
using namespace One;
namespace Two {
#if 1
enum foo {
c,
};
#else
typedef enum {
c,
} foo;
#endif
}