typedef-named class member functions can be public

Alexandre Oliva aoliva@redhat.com
Fri Jul 5 01:21:00 GMT 2002


A class defined like this:

typedef class {...} foo;

has linkage, but its member functions don't have the public flag set,
even when they're defined outside the class body.  The problem appears
to be that duplicate_decls() just copies TREE_PUBLIC (olddecl) to the
new decl, so the public flag set in new decl is lost.  Oops.

This patch fixes the problem.  I can't include the testcase I was
given because it's derived from a proprietary testsuite, so I'd
appreciate if someone would come up with a testcase based on my
description of the problem for the GCC testsuite.  Thanks in advance.

This patch was tested on athlon-pc-linux-gnu-x-mn10300-elf.  Ok to
install?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cp-ctor-of-typedef-class.patch
Type: text/x-patch
Size: 1793 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20020705/d742a7c3/attachment.bin>
-------------- next part --------------

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


More information about the Gcc-patches mailing list