This is the mail archive of the
egcs-bugs@egcs.cygnus.com
mailing list for the EGCS project.
-pendantic & overload resolution
- To: egcs-bugs <egcs-bugs@egcs.cygnus.com>
- Subject: -pendantic & overload resolution
- From: Thomas Kunert <kunert@physik.tu-dresden.de>
- Date: Mon, 12 Jul 1999 15:41:01 +0000
- Organization: TU Dresden
In the following exampl, `-pedantic' changes the overload resolution
rules badly.
Thomas Kunert
[root@ptpp03 opm]# g++ -v
Reading specs from /opt/lib/gcc-lib/i686-pc-linux-gnu/gcc-2.95/specs
gcc version gcc-2.95 19990623 (prerelease)
[root@ptpp03 opm]# g++ -c h2.cc
[root@ptpp03 opm]# g++ -c h2.cc -pedantic
h2.cc: In function `void g(const AWave &, const RArray<int> &)':
h2.cc:17: call of overloaded `f (const AWave &, const RArray<int> &)' is
ambiguous
h2.cc:5: candidates are: void f<int, int>(const RArray<int> &, const
RArray<int> &)
h2.cc:13: void f(const AWave &, const AWave &)
[root@ptpp03 opm]# cat h2.cc
template <class M >
class RArray {};
template <class M1, class M2>
void f( const RArray< M1>& a, const RArray<M2>& b ) ;
class AWave : public RArray<int>
{
public:
AWave( const RArray< int>& t );
};
void f( const AWave& a, const AWave& b );
void g( const AWave& a, const RArray<int>& b )
{
f(a,b);
}