This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/6992: [3.2/3.3 regression?] GCC-3.1.x - attribute 'section' broken for constructors
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, petr at scssoft dot com
- Date: 22 Nov 2002 01:20:22 -0000
- Subject: Re: c++/6992: [3.2/3.3 regression?] GCC-3.1.x - attribute 'section' broken for constructors
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, petr at scssoft dot com, gcc-gnats at gcc dot gnu dot org
Old Synopsis: GCC-3.1.x - attribute 'section' broken for constructors
New Synopsis: [3.2/3.3 regression?] GCC-3.1.x - attribute 'section' broken for constructors
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Thu Nov 21 17:20:21 2002
State-Changed-Why:
This is a regression -- sort of, because I do not know
whether it is legal: starting with gcc3.[12].*, this code
is rejected:
-----------------------------
class a {
public:
__attribute__((section("whatever"))) a();
};
------------------------------
The message I get is this:
tmp/g> /home/bangerth/bin/gcc-3.3y-pre/bin/c++ -c x.cc
x.cc:3: warning: `section' attribute ignored
x.cc:3: error: declaration does not declare anything
x.cc:3: error: parse error before `)' token
Now, what is indeed surprising is that this only happens
for the constructor. It compiles just fine if the attribute
is applied to a normal member function.
On the other hand, if I place the attribute specification
_after_ the constructor declaration, then it works, so
maybe it compiled "by accident" before. It is inconsistent,
though.
Since this is a change, I place this report into "high"
priority, so that at least someone will clarify the situation.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6992