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

2017-05-12  Paolo Carlini  <paolo.carlini@oracle.com>

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

From-SVN: r247969
This commit is contained in:
Paolo Carlini 2017-05-12 13:20:21 +00:00 committed by Paolo Carlini
parent 06ace75d4b
commit 9206028e8c
3 changed files with 36 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2017-05-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/49604
* g++.dg/cpp0x/forw_enum14.C: New.
* g++.dg/cpp0x/forw_enum15.C: Likewise.
2017-05-12 Richard Biener <rguenther@suse.de>
* g++.dg/tree-ssa/ssa-dse-2.C: Adjust.

View File

@ -0,0 +1,16 @@
// PR c++/49604
// { dg-do compile { target c++11 } }
class MyTable {
public:
enum Constants : unsigned;
};
enum MyTable::Constants : unsigned {
LENGTH = 12,
};
int main()
{
return MyTable::LENGTH;
}

View File

@ -0,0 +1,14 @@
// PR c++/49604
// { dg-do compile { target c++11 } }
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; // { dg-error "private" }