c++/6992: GCC-3.1.x - attribute 'section' broken for constructors

petr@scssoft.com petr@scssoft.com
Tue Jun 11 07:17:00 GMT 2002


>Number:         6992
>Category:       c++
>Synopsis:       GCC-3.1.x - attribute 'section' broken for constructors
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 11 07:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     petr@scssoft.com
>Release:        gcc-3.1.x
>Organization:
>Environment:
debian linux x86
>Description:
class a {
  public:
    __attribute__((section("whatever"))) a();
    __attribute__((section("whatever"))) void b(void);
};

this is how it used to work until gcc-3.0.4 or so...
after upgrading to gcc-3.1 (debian package), the
code chunk mentioned before fails to compile with this complaint (only for the class constructor):

warning: 'section' attribute ignored
declaration does not declare anything
parse error before ')' token

however, this works:

class a {
  public:
    a() __attribute__((section("whatever")));
    __attribute__((section("whatever"))) void b(void);
};

shouldn't be theese two constructor declarations equivalent?
a() __attribute__((section("whatever")));
__attribute__((section("whatever"))) a();
>How-To-Repeat:
try to compile this:
class a {
  public:
    __attribute__((section("whatever"))) a();
};
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list