This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19966] New: Misleading message "must take exactly one argument"
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Feb 2005 01:17:14 -0000
- Subject: [Bug c++/19966] New: Misleading message "must take exactly one argument"
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following invalid code snippet causes a bogus error message:
==============================
struct A
{
static operator int();
};
==============================
bug.cc:3: error: 'static A::operator int()' must be a nonstatic member function
bug.cc:3: error: 'static A::operator int()' must take exactly one argument
The first part is ok, but the second part is bogus, as the operator
(once made non-static) will take no argument. Well, the this-pointer
could be counted as an argument, but this is nevertheless confusing
for the user. Especially, since the second error message will indeed
go away if one adds a parameter.
--
Summary: Misleading message "must take exactly one argument"
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: diagnostic, monitored
Severity: minor
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19966