This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49604] forward-declared enum's elements in class scope gets default access (class vs struct)
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 1 Jul 2011 03:51:31 +0000
- Subject: [Bug c++/49604] forward-declared enum's elements in class scope gets default access (class vs struct)
- Auto-submitted: auto-generated
- References: <bug-49604-4@http.gcc.gnu.org/bugzilla/>
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;