1  // PR 40614
       2  // { dg-options "-Werror=unused-result" }
       3  /* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
       4  class QByteArray {
       5  public:
       6    QByteArray(const QByteArray &);
       7  };
       8  class QString {
       9    QByteArray toLocal8Bit() const __attribute__ ((warn_unused_result));
      10    void fooWarnHere() const { toLocal8Bit(); } // { dg-error "ignoring" }
      11  };