This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/19966] New: Misleading message "must take exactly one argument"


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]