[Bug c++/49604] forward-declared enum's elements in class scope gets default access (class vs struct)
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jul 1 03:51:00 GMT 2011
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;
More information about the Gcc-bugs
mailing list