This is the mail archive of the gcc-bugs@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]

[Bug c++/27370] New: Bogus warning about ignoring function return value (__attribute__ ((warn_unused_result)))


class QByteArray {
public:
  QByteArray(const QByteArray &);
};
class QString {
  QByteArray toLocal8Bit() const __attribute__ ((warn_unused_result));
  inline QByteArray local8Bit() const{ return toLocal8Bit(); }
};

Produces with g++ -S -Wall:

test.1.1.min.ii: In member function 'QByteArray QString::local8Bit() const':
test.1.1.min.ii:7: warning: ignoring return value of 'QByteArray
QString::toLocal8Bit() const', declared with attribute warn_unused_result


-- 
           Summary: Bogus warning about ignoring function return value
                    (__attribute__ ((warn_unused_result)))
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


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