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:
parent
06ace75d4b
commit
9206028e8c
@ -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.
|
||||
|
16
gcc/testsuite/g++.dg/cpp0x/forw_enum14.C
Normal file
16
gcc/testsuite/g++.dg/cpp0x/forw_enum14.C
Normal 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;
|
||||
}
|
14
gcc/testsuite/g++.dg/cpp0x/forw_enum15.C
Normal file
14
gcc/testsuite/g++.dg/cpp0x/forw_enum15.C
Normal 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" }
|
Loading…
Reference in New Issue
Block a user