This is the mail archive of the gcc-prs@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: c++/6992: [3.2/3.3 regression?] GCC-3.1.x - attribute 'section' broken for constructors


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


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