This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/1901: class method, when overloaded, hides methods with the same name
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/1901: class method, when overloaded, hides methods with the same name
- From: vladimir dot kondratiev at intel dot com
- Date: 7 Feb 2001 15:11:49 -0000
- Reply-To: vladimir dot kondratiev at intel dot com
>Number: 1901
>Category: c++
>Synopsis: class method, when overloaded, hides methods with the same name
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Wed Feb 07 07:16:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Vladimir Kondratiev
>Release: gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
Linux/Intel RedHat 7.0; glibc 2.2, gcc was compiled with patch from gcc home page; no flags to 'configure'
>Description:
Assume there are class A and class B : public A;
in class A there are several methods with the same name but different parameters. Class B overloads one of the methods mentioned above.
Now, when one calls for object of class B method inherited from class A, error message is generated.
Since there is no preprocessor code and .ii file is identical to the .cpp one, I attached .cpp only
Compiler output:
[vkondra-l@vkondra-mobl gcc-bug]$ gcc -c test.cpp
test.cpp: In function `int main(int, char **)':
test.cpp:14: no matching function for call to `B::f (int, int)'
test.cpp:9: candidates are: void B::f(int)
>How-To-Repeat:
gcc -c test.cpp
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/cpp; name="test.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.cpp"
Y2xhc3MgQSB7CnB1YmxpYzoKICB2b2lkIGYoaW50KSB7fQogIHZvaWQgZihpbnQsaW50KSB7fQp9
OwoKY2xhc3MgQiA6IHB1YmxpYyBBIHsKcHVibGljOgogIHZvaWQgZihpbnQpIHt9Cn07CgppbnQg
bWFpbihpbnQsIGNoYXIqW10pIHsKICBCIGI7CiAgYi5mKDAsMCk7Cn0K