This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: reject vars whose types have no linkage
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 17 Feb 2005 22:49:32 -0200
- Subject: Re: reject vars whose types have no linkage
- Organization: Red Hat Global Engineering Services Compiler Team
- References: <or650qkibn.fsf@livre.redhat.lsd.ic.unicamp.br>
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}