http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56763



             Bug #: 56763

           Summary: "attribute ignored in declaration of " warning points

                    to wrong place

    Classification: Unclassified

           Product: gcc

           Version: unknown

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: kai.koe...@digia.com





When putting an attribute at the wrong place in a friends declaration, gcc does

point incorrectly to the actual class declaration. E.g.





--

class __attribute__((visibility("default"))) X {

};



class Y {

    friend __attribute__((visibility("default"))) class X;

};



int main(int , char *[])

{

}

--



will print



--

./gccattributewarning/main.cpp:1:46: warning: attribute ignored in declaration

of 'class X' [-Wattributes]

 class __attribute__((visibility("default"))) X {

                                              ^

../gccattributewarning/main.cpp:1:46: note: attribute for 'class X' must follow

the 'class' keyword

--



. What I would have expected is that it points to main.cpp:5 instead.

Reply via email to