aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2010-09-23 22:21:39 +0000
committerNicola Pero <nicola@gcc.gnu.org>2010-09-23 22:21:39 +0000
commit19dc6d015261862f1335587ab362f79a89dfc0c9 (patch)
tree680cb9863c1843acf4a5ee0d2815beb43af9ab54 /gcc/cp
parent452648a89bd6f147245b795ac2880f34075685fa (diff)
downloadgcc-19dc6d015261862f1335587ab362f79a89dfc0c9.zip
gcc-19dc6d015261862f1335587ab362f79a89dfc0c9.tar.gz
gcc-19dc6d015261862f1335587ab362f79a89dfc0c9.tar.bz2
In gcc/:
* c-typeck.c (convert_arguments): Use warning 'too many arguments to method [methodname]' for an Objective-C method instead of the less satisfactory 'too many arguments to function' (with no method name). In gcc/cp/: * typeck.c (warn_args_num): Use warning 'too many arguments to method [methodname]' for an Objective-C method instead of the less satisfactory 'too many arguments to function' (with no method name). In gcc/testsuite/: * obj-c++.dg/too-many-args.mm: New file. Merge from 'apple/trunk' branch on FSF servers. 2006-03-27 Fariborz Jahanian <fjahanian@apple.com> Radar 4491608 * objc.dg/too-many-args.m: New From-SVN: r164573
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/typeck.c13
2 files changed, 18 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3994a3a..95613b0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * typeck.c (warn_args_num): Use warning 'too many arguments to
+ method [methodname]' for an Objective-C method instead of the less
+ satisfactory 'too many arguments to function' (with no method
+ name).
+
2010-09-21 Jason Merrill <jason@redhat.com>
* mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 0ac95d0..019c51e 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -3428,8 +3428,17 @@ warn_args_num (location_t loc, tree fndecl, bool too_many_p)
"declared here");
}
else
- error_at (loc, too_many_p ? G_("too many arguments to function")
- : G_("too few arguments to function"));
+ {
+ if (c_dialect_objc () && objc_message_selector ())
+ error_at (loc,
+ too_many_p
+ ? G_("too many arguments to method %q#D")
+ : G_("too few arguments to method %q#D"),
+ objc_message_selector ());
+ else
+ error_at (loc, too_many_p ? G_("too many arguments to function")
+ : G_("too few arguments to function"));
+ }
}
/* Convert the actual parameter expressions in the list VALUES to the