gcc/testsuite/g++.dg/pr61941.C
raw| 1 | // PR c++/61941 - Misparsing of warn_unused_result function with ref-qualifiers |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-options "-Wall" } |
| 4 | |
| 5 | class S |
| 6 | { |
| 7 | public: |
| 8 | S x() const __attribute__ ((__warn_unused_result__)); |
| 9 | |
| 10 | S y() const & __attribute__ ((__warn_unused_result__)); |
| 11 | S y() && __attribute__ ((__warn_unused_result__)); |
| 12 | }; |