From 026af5602fc92795148a60456abc14019df631ff Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 12 Aug 2015 14:47:58 +0000 Subject: [PATCH] re PR c++/47461 (warn_unused_result attribute ignored for templates) 2015-08-12 Paolo Carlini PR c++/47461 * g++.dg/warn/Wunused-result-1.C: New. From-SVN: r226816 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/warn/Wunused-result-1.C | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 gcc/testsuite/g++.dg/warn/Wunused-result-1.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 15b0b41a7b5..af43f4df552 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-08-12 Paolo Carlini + + PR c++/47461 + * g++.dg/warn/Wunused-result-1.C: New. + 2015-08-12 Richard Biener * gcc.dg/tree-ssa/ssa-fre-47.c: New testcase. diff --git a/gcc/testsuite/g++.dg/warn/Wunused-result-1.C b/gcc/testsuite/g++.dg/warn/Wunused-result-1.C new file mode 100644 index 00000000000..4d08cf0d430 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wunused-result-1.C @@ -0,0 +1,8 @@ +// PR c++/47461 + +class C { + public: + template bool f(T* m) __attribute__((warn_unused_result)); +}; +template inline bool C::f(T* m) { return true; } +void f(C* pc) { int i; pc->f(&i); } // { dg-warning "ignoring return value" } -- 2.30.2