This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Question about __attribute__ (mis)handling
- From: Ira Ruben <ira at apple dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 12 Dec 2001 11:38:27 -0800
- Subject: 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