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

2017-05-12 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49604

Paolo Carlini  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.0

--- Comment #8 from Paolo Carlini  ---
Done.

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

2017-05-12 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49604

--- Comment #7 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Fri May 12 13:20:21 2017
New Revision: 247969

URL: https://gcc.gnu.org/viewcvs?rev=247969=gcc=rev
Log:
2017-05-12  Paolo Carlini  

PR c++/49604
* g++.dg/cpp0x/forw_enum14.C: New.
* g++.dg/cpp0x/forw_enum15.C: Likewise.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/forw_enum14.C
trunk/gcc/testsuite/g++.dg/cpp0x/forw_enum15.C
Modified:
trunk/gcc/testsuite/ChangeLog

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

2017-05-12 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49604

--- Comment #6 from Paolo Carlini  ---
This is fixed in 7.1.0. I'm adding testcases and closing the bug.

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

2016-02-01 Thread felix.abecassis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49604

Felix Abecassis  changed:

   What|Removed |Added

 CC||felix.abecassis at gmail dot 
com

--- Comment #4 from Felix Abecassis  ---
Confirmed again with gcc 5.3.1 on Ubuntu 16.04.
I reused the same test case than Melissa.

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

2016-02-01 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49604

Martin Sebor  changed:

   What|Removed |Added

   Keywords|accepts-invalid |
   Last reconfirmed|2014-10-16 00:00:00 |2016-2-1
 CC||msebor at gcc dot gnu.org
  Known to fail||4.9.3, 5.3.0, 6.0

--- Comment #5 from Martin Sebor  ---
All supported versions of GCC, including the current trunk of 6.0, have the
problem.  The test case seems strictly valid, though, so removing the
accepts-invalid keyword.

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

2014-10-16 Thread myriachan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49604

Melissa myriachan at gmail dot com changed:

   What|Removed |Added

 CC||myriachan at gmail dot com

--- Comment #3 from Melissa myriachan at gmail dot com ---
Happens for me on 5.0.0 build 2014/10/15 (via wandbox) through 4.6.x - whenever
typed enums were added.

Simpler test case than the original:


class MyTable {
public:
enum Constants : unsigned;
};

enum MyTable::Constants : unsigned {
LENGTH = 12,
};

int main()
{
return MyTable::LENGTH;
}


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

2014-10-16 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49604

Jonathan Wakely redi at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||accepts-invalid,
   ||rejects-valid
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-10-16
 Ever confirmed|0   |1


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

2014-03-28 Thread b.r.longbons at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49604

--- Comment #2 from Ben Longbons b.r.longbons at gmail dot com ---
Still an issue with 4.9 as of 2014-03-22


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

2011-06-30 Thread pinskia at gcc dot gnu.org
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;