gcc/cp/ChangeLog: PR c++/70241 * decl.c (build_enumerator): Set current_access_specifier when declaring an enumerator belonging to an in-class enumeration. * parser.c (cp_parser_check_access_in_redecleration): Also consider in-class enumerations. gcc/testsite/ChangeLog: PR c++/70241 * g++.dg/cpp0x/enum32.C: New test. * g++.dg/cpp0x/enum33.C: New test. From-SVN: r235456
26 lines
249 B
C
26 lines
249 B
C
// PR c++/70241
|
|
// { dg-do compile { target c++11 } }
|
|
|
|
class A {
|
|
public:
|
|
enum B : int;
|
|
};
|
|
|
|
enum A::B : int {
|
|
x
|
|
};
|
|
|
|
struct C {
|
|
private:
|
|
enum D : int;
|
|
};
|
|
|
|
enum C::D : int {
|
|
y
|
|
};
|
|
|
|
int main() {
|
|
A::x;
|
|
C::y; // { dg-error "private" }
|
|
}
|