Enough already with the KDE bug!

Hyman Rosen hymie@prolifics.com
Mon Mar 30 19:05:00 GMT 1998


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.



More information about the Gcc-bugs mailing list