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: [PATCH] Fix PR C++/9021 and 11005


 --- Jason Merrill <jason@redhat.com> wrote: > On Thu, 11 Dec 2003 21:59:29
+1100 (EST), Danny Smith
> <danny_r_smith_2001@yahoo.co.nz> wrote:
> 
> >
> > 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.

Right.  But only if the new attribute is not contained within the old list.
struct __attribute__((dllimport)) Foo3
{
  int foo3fun(void) const;
};

struct  __attribute__((dllimport)) Foo3; //  No warning/error.

If so, I need to find/write a function that checks if the new attributes are
contained in the old list 

> 
> > 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 

http://personals.yahoo.com.au - Yahoo! Personals
New people, new possibilities. FREE for a limited time.


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