This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17796] [3.4/4.0 Regression] Too many unused parameter warnings emitted.
- From: "phython at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jan 2005 00:35:24 -0000
- Subject: [Bug c++/17796] [3.4/4.0 Regression] Too many unused parameter warnings emitted.
- References: <20041002200629.17796.jakub@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From phython at gcc dot gnu dot org 2005-01-24 00:35 -------
Something like the following patch should work:
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.602
diff -u -p -r1.602 function.c
--- function.c 13 Jan 2005 17:06:44 -0000 1.602
+++ function.c 24 Jan 2005 00:33:50 -0000
@@ -4360,6 +4360,10 @@ do_warn_unused_parameter (tree fn)
{
tree decl;
+ /* Don't give any warnings about abstract, inlined or cloned, functions. */
+ if (DECL_FROM_INLINE (fn) && TREE_CHAIN (fn) != NULL_TREE)
+ return;
+
for (decl = DECL_ARGUMENTS (fn);
decl; decl = TREE_CHAIN (decl))
if (!TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL
--
Unfortunatly, this causes g++.old-deja/g++.other/warn7.C to fail.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17796