PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wunused-result-2.C
blob56ed17a6abe864c61d2bf7f0b33532594974f3a9
1 // PR c++/66177
3 struct QSize
5     QSize(int w, int h) : wd(w), ht(h) {}
7     QSize expandedTo() const __attribute__ ((__warn_unused_result__))
8     {
9         return QSize(2, 3);
10     }
12 private:
13     int wd;
14     int ht;
17 void foo()
19     QSize sz(2, 2);
20     sz.expandedTo();            // { dg-warning "warn_unused_result" }