Preview: PATCH to overhaul C++ visibility handling

Jason Merrill jason@redhat.com
Fri Jun 23 20:33:00 GMT 2006


This patch reimplements large chunks of the visibility handling in GCC 
to improve handling of type visibility.  Notable changes:

Visibility restrictions are propagated from class to members (26905), 
and from template arguments to instantiations (26612).

We now give an error if a declaration has higher visibility than its 
type, or if a class has higher visibility than one of its non-static 
data member types.

Declarations in the anonymous namespace, or declarations which use types 
from the anonymous namespace, etc. are now local to the file (21581, 25915).

An explicit visibility attribute on a class must come between the 
class-key and the name, not after the closing brace.

Attributes are now allowed on elaborated-type-specifiers that only 
declare the type (21675), and after the 'enum' keyword in enum definitons.

Multiple inconsistent visibility attributes give an error.

Tested x86_64-pc-linux-gnu.

I've actually made a bunch more changes since this patch to fix corner 
cases from bug reports, but I haven't had a chance to do regression 
testing of the current patch, so I thought I'd toss this out for 
interested folk to get an idea of the direction I'm going.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vis2.patch
Type: text/x-patch
Size: 54651 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060623/ee8cd9e6/attachment.bin>


More information about the Gcc-patches mailing list