re PR c++/47461 (warn_unused_result attribute ignored for templates)
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 12 Aug 2015 14:47:58 +0000 (14:47 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 12 Aug 2015 14:47:58 +0000 (14:47 +0000)
2015-08-12  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/47461
* g++.dg/warn/Wunused-result-1.C: New.

From-SVN: r226816

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wunused-result-1.C [new file with mode: 0644]

index 15b0b41a7b5bec1e54a5ab4359a61a64b9f2422a..af43f4df552317a699229cf07c986de454373bf3 100644 (file)
@@ -1,3 +1,8 @@
+2015-08-12  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/47461
+       * g++.dg/warn/Wunused-result-1.C: New.
+
 2015-08-12  Richard Biener  <rguenther@suse.de>
 
        * 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 (file)
index 0000000..4d08cf0
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/47461
+
+class C {
+ public:
+  template<typename T> bool f(T* m) __attribute__((warn_unused_result));
+};
+template<typename T> inline bool C::f(T* m) { return true; }
+void f(C* pc) { int i; pc->f(&i); }  // { dg-warning "ignoring return value" }