This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR C++/9021 and 11005
- From: Jason Merrill <jason at redhat dot com>
- To: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 12 Dec 2003 11:35:09 -0500
- Subject: Re: [PATCH] Fix PR C++/9021 and 11005
- References: <20031211105929.41830.qmail@web60806.mail.yahoo.com>
On Thu, 11 Dec 2003 21:59:29 +1100 (EST), Danny Smith <danny_r_smith_2001@yahoo.co.nz> wrote:
> --- Jason Merrill <jason@redhat.com> wrote:
>> I think it probably makes sense to use your patch, but make it conditional
>> on whether or not the class is complete; if it is, then specifying
>> additional attributes is an error.
>
> Maybe. This rule:
> "If !COMPLETE_TYPE_P, merge attributes, else ignore the new attributes"
That's not what I was proposing. Rather, ... else give an error if new
attributes are specified.
> // Case 3:
> // Finally, this is the case where we try to add an attribute
> // to a complete type.
>
> // Definition without attribute, followed by a redeclaration
> // with attribute.
>
>
> struct Foo3
> {
> int foo3fun(void) const;
> };
>
> struct __attribute__((dllimport)) Foo3; // Ignore attribute?
Error.
> Even without a check for COMPLETE_TYPE_P before merging attributes,
> foo3fun doesn't get marked as dllimport.
Silently ignoring the user is never a good idea. If we can't do what they
ask for, we should tell them so.
Jason