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

            Bug ID: 93138
           Summary: [10 regression] elaborated type specifier visibility
                    check problem
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: s...@li-snyder.org
  Target Milestone: ---

hi -

With this version of gcc10 (svn rev 279832):

  gcc version 10.0.0 20200102 (experimental) (GCC)

This source does not compile:

-- x.cc -----------------------------------------------------
struct Foo
{
  enum Kind { a };

private:
  Kind Kind;
};

enum Foo::Kind foo();
-------------------------------------------------------------

$ g++ -std=c++17 -c x.cc
x.cc: In function ‘Foo::Kind foo()’:
x.cc:9:11: error: ‘Foo::Kind Foo::Kind’ is private within this context
    9 | enum Foo::Kind foo();
      |           ^~~~
x.cc:6:8: note: declared private here
    6 |   Kind Kind;
      |        ^~~~
$

This does compile OK with gcc 9.2.1 and with clang 8.0.0
The source from which this was reduced also built ok with gcc trunk
10.0.0 20191202.

Reply via email to