From 98ef99ab97b84f526a401d8d96b9aca52c0daad7 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Fri, 14 Sep 2018 16:41:37 +0000 Subject: [PATCH] c++/61941 - Mis-parsing of warn_unused_result function with ref-qualifiers gcc/testsuite/ChangeLog: * g++.dg/pr61941.C: New test. From-SVN: r264324 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/pr61941.C | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 gcc/testsuite/g++.dg/pr61941.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b065b402749..a5ea71e88a6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-14 Martin Sebor + + c++/61941 + * g++.dg/pr61941.C: New test. + 2018-09-14 Kyrylo Tkachov * gcc.target/aarch64/combine_bfi_1.c: Scan for bfi instruction diff --git a/gcc/testsuite/g++.dg/pr61941.C b/gcc/testsuite/g++.dg/pr61941.C new file mode 100644 index 00000000000..5485b982cc7 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr61941.C @@ -0,0 +1,12 @@ +// PR c++/61941 - Misparsing of warn_unused_result function with ref-qualifiers +// { dg-do compile { target c++11 } } +// { dg-options "-Wall" } + +class S +{ +public: + S x() const __attribute__ ((__warn_unused_result__)); + + S y() const & __attribute__ ((__warn_unused_result__)); + S y() && __attribute__ ((__warn_unused_result__)); +}; -- 2.30.2