https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61229

            Bug ID: 61229
           Summary: warn_unused_result fails to work with member functions
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: plasmahh at gmx dot net

Since gcc 4.5 (4.4 is fine) the following code will not emit any warning:

struct A 
{
        __attribute__((warn_unused_result)) int callme( ) { return 42; }
};


struct B
{
        void foo( A& a )
        {
            a.callme();
        }
};

Reply via email to