From: Paolo Carlini Date: Wed, 12 Aug 2015 14:47:58 +0000 (+0000) Subject: re PR c++/47461 (warn_unused_result attribute ignored for templates) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=026af5602fc92795148a60456abc14019df631ff;p=gcc.git 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 --- 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" }