This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Enough already with the KDE bug!


Martin von Loewis writes:
 > It seems to me that the union is a local class as described in
 > [class.local]. In that section, the standard says
 > 
 >   A class can be defined within a function definition; such a class is
 >   called a local class. The name of a local class is local to its
 >   enclosing scope. The local class is in the scope of the enclosing
 >   scope, and has the same access to names outside the function as does
 >   the enclosing function.
 > 
 > Since `i'is a name outside the member function, the local class can
 > access it since the function can. So `i' should be accessible, even
 > though it is private.
 > 
 > What do you think?

Paragraph one of [class.local] says

	Declarations in a local class can use only type names,
	static variables, extern variables and functions, and
	enumerators from the enclosing scope.

The name 'i' is none of these.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]