Full name of submitter: Victor Chernyakin
Issue Description
[class.local]/3 says:
A class nested within a local class is a local class. A member of a local class X shall be declared only in the definition of X or, if the member is a nested class, in the nearest enclosing block scope of X.
Under this wording, defining a struct out-of-line is allowed, but defining an enum is not:
void f() {
struct X {
struct S;
enum E : int;
};
struct X::S {}; // okay
enum X::E : int {}; // ill-formed
}
However, all major implementations accept this code, and there seems to be no reason that it should be disallowed.
Proposed resolution
A class nested within a local class is a local class. A member of a local class X shall be declared only in the definition of X or, if the member is an enumeration or a nested class, in the nearest enclosing block scope of X.
Full name of submitter: Victor Chernyakin
Issue Description
[class.local]/3 says:
Under this wording, defining a struct out-of-line is allowed, but defining an enum is not:
However, all major implementations accept this code, and there seems to be no reason that it should be disallowed.
Proposed resolution