summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/unused-result1-Werror.c
blob: fc14469c319d6166d6661f6e7d08d235c21f5d5e (plain)
1
2
3
4
5
6
7
8
9
10
11
// PR 40614
// { dg-options "-Werror=unused-result" }
/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
class QByteArray {
public:
  QByteArray(const QByteArray &);
};
class QString {
  QByteArray toLocal8Bit() const __attribute__ ((warn_unused_result));
  void fooWarnHere() const { toLocal8Bit(); } // { dg-error "ignoring" }
};