c++/225: using declaration doesn't take into account member overloading

matt_conway@i2.com matt_conway@i2.com
Wed May 17 13:56:00 GMT 2000


>Number:         225
>Category:       c++
>Synopsis:       using declaration doesn't take into account member overloading
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed May 17 13:56:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     matt_conway@i2.com
>Release:        2.96 (snapshot 20000410)
>Organization:
>Environment:
System: Linux buick 2.2.14-15mdksmp #1 SMP Tue Jan 4 21:36:33 CET 2000 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
>Description:
While performing a using declaration in a derived class for method names in a base class, g++ doesn't seem to be able to pull in the member function of a base class if the function with the same name but different args exists in the derived class.

When compiling the attached file, g++ reports the following error:
gcc-using-bug.cpp:19: cannot adjust access to `int Foo::Baz(const char *) const' in `class Bar'
gcc-using-bug.cpp:17:   because of local method `int Bar::Baz(char, int)' with same name

The code in the attached file seems to be correct according to the ISO C++ standard (section 7.3.3 item 14)- but then I may be misinterpreting the standard (?)

>How-To-Repeat:
g++ -c gcc-using-bug.cpp
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the Gcc-prs mailing list