This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: reject vars whose types have no linkage


On Feb 17, 2005, Alexandre Oliva <aoliva@redhat.com> wrote:

> The relevant DRs seem to all point towards rejecting such code.  Since
> -fpermissive is always an option to let pedwarns through, I thought
> we'd be better off rejecting both, as per the current DR resolutions.

FWIW, this patch regressed g++.dg/lookup/anon3.C, which introduces the
conflicting requirement with anon2.C.  I suppose we should use warning
instead of pedwarn, giving users early warning that the code is
nonsensical and almost certainly will become ill-formed, although
still acceptable by the current standard.  Then we'll be
forward-compatible with the revised standard, since we'll issue a
diagnostic, and also compatible with the current standard, since the
code is accepted.  Comments?

> 	* decl.c (grokvardecl): Don't exempt anonymous types from having
> 	linkage for variables that have linkage other than "C".

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


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