https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87035

            Bug ID: 87035
           Summary: Can't shadow global const int with unnamed enum in
                    class
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: blitzrakete at gmail dot com
  Target Milestone: ---

const int N = 5;

struct X {
  int Array[N]; // int[5]
  enum { N }; // fails, redeclaration
};

This is well-formed, as the enum value N is in another scope and so shadows
::N. Removing the array declaration makes the code also compile.

Reply via email to