http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55776

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
The warning seems correct to me; within the scope of myenum (i.e. in the
initializers of other enumerators) the foo enumerator shadows the global foo.

typedef int foo;

enum class myenum
{
  foo,
  bar = foo // finds myenum::foo
};

If the order of the typedef and the enum is reversed, there is no warning
because there is no shadowing; in that case, if the foo enumerator had a
different name, the reference in the initializer of bar would just be an error.

Reply via email to