This is the mail archive of the gcc@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]

Question about __attribute__ (mis)handling


I have a question about __attribute__ handling for C++ inline member 
functions.  Given the following example:

struct T1 {
   void __attribute__ ((this_will_be_a_warning)) t1_member1();
   void t1_member2() __attribute__ ((this_will_be_an_warning_too));
};

struct T2 {
   void __attribute__ ((this_should_also_be_an_warning)) t2_member1() {}
   void t2_member2();
};

inline void __attribute__ ((it_catches_this_as_a_warning_here))
T2::t2_member2() {}

int foo(T2 *p)
{
   p->t2_member1();
}

It turns out that an __attribute__ for inline members defined within 
their class is effectively ignored when the __attribute__ is placed 
before the function name.  So should this be considered a bug?  Or 
should __attribute__ in that position even be allowed?

Ira


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