This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25994] New: Using declarations and base function overloading
- From: "wolfgang dot roehrl at gi-de dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jan 2006 12:51:27 -0000
- Subject: [Bug c++/25994] New: Using declarations and base function overloading
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Dear all,
I would like to post a bug report for the GNU C/C++ compiler 3.3-e500.
We use the compiler to generate code for a PowerPC processor.
Used invokation line for the GNU C++ compiler:
ccppc -c -x c++ -ansi -Wall -Werror -mcpu=8540 -fverbose-asm -mbig
-fmerge-templates -mmultiple -mno-string -mstrict-align -O3
-fno-exceptions -fno-rtti -fno-builtin-printf
-I<different include paths>
-D<differen #define's>
X.CPP -oX.O
// file X.CPP
struct B1
{
void f (char);
void f (double);
};
struct B2
{
void f (int);
void f (double); // <--- line 10
};
struct D : public B1, public B2
{
using B1::f;
using B2::f;
void g ()
{
f ('a'); // should call B1::f(char)
f (33); // should call B2::f(int)
}
};
The compiler gives the following error message:
X.CPP:10: error: `void B2::f(double)' and `void B1::f(double)' cannot be
overloaded
I think this is not standard conforming. See 7.3.3/12: "[ Note: two using
declarations may introduce functions with the same name and the same parameter
types. If, for a call to an unqualified function name, function overload
resolution selects the functions introduced by such using declarations, the
function call is illformed. ]"
Kind regards
W. Roehrl
--
Summary: Using declarations and base function overloading
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: wolfgang dot roehrl at gi-de dot com
GCC build triplet: sparc-sun-solaris2.5.1
GCC host triplet: i386-pc-mingw32
GCC target triplet: powerpc-wrs-vxworks
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25994