This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/49604] forward-declared enum's elements in class scope gets default access (class vs struct)


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|forward-declared enum in    |forward-declared enum's
                   |class scope is private in   |elements in class scope
                   |context of constexpr        |gets default access (class
                   |                            |vs struct)

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-07-01 03:51:29 UTC ---
>It works fine without the constexpr.

I have the same failure even without constexpr.

Here is a testcase which should fail but currently is accepted:
struct Foo
{
private:
    int val;
    enum impl_t : int;
public:
    Foo(impl_t v) : val(v) {}
};
enum Foo::impl_t : int { X };

Foo test = Foo::X;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]