Re: Strange "No matching function for call" compilation error with G++ 4.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,

Just resend this letter again with adding reproduction code.  Any
comments/suggestions are higly appreciated.

I am porting some code to SUSE 10, with G++ 4.1. And hit an strange
"no matching function call" compilation error.  I am confused because
the calling function and candidate are nearly 100% same.

I wonder if this is a known G++ limitation or issue ? Because the same
program got compiled with VC8.

Below is the compilation environment info and compilation error.

env info
=========
g++ (GCC) 4.1.0  (SLES10), can also be found with g++ 3.2 (UL1.0)

No compile option is added


Compilation error
=================
no matching function for call to tdat_hash_map<MemAllocator<int>
::func(MemAllocator<int>)

main.cpp:6: note: candidates are: static void
tdat_hash_map<_AllocType>::func(_AllocType&)
[with _AllocType = MemAllocator<int>]


Repro code
===========
template <class Type> class MemAllocator{};

template <class _AllocType> class tdat_hash_map {
public:
	typedef _AllocType _Alloc;
	static void func(_Alloc&) {};
};

int main()
{
	typedef tdat_hash_map<MemAllocator<int> > Map;
	Map::func((MemAllocator<int>) (MemAllocator<int>()));

	return 0;
}




Thanks,
-Kelvin


On 9/27/06, Yuanfei guo <yuanfei8077@xxxxxxxxx> wrote:
Hi there,

I am porting some code to SUSE 10, with G++ 4.1. And hit an strange
"no matching function call" compilation error.  I am confused because
the calling function and candidate are nearly 100% same.

I wonder if this is a known G++ limitation or issue ? Because the same
program got compiled with VC8.

Below is the compilation environment info and compilation error.

 env info
=========
g++ (GCC) 4.1.0  (SUSE Linux)

No compile option is added


Compilation error
==============
 ./Cache/CacheManager.h:424: error: no matching function for call to
tdat_hash_map<std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >, Element<unsigned int, SqlObjectDefn,
std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> > >*,
MemAllocator<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >, Element<unsigned
int, SqlObjectDefn, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >*> >
>::tdat_hash_map1(MemAllocator<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >, Element<unsigned
int, SqlObjectDefn, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >*> >, int)

./Common/TdatHashMap.h:250: note: candidates are: static void
tdat_hash_map<_Key, _Tp, _AllocType>::tdat_hash_map1(_AllocType&, int)
[with _Key = std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >, _Tp = Element<unsigned int, SqlObjectDefn,
std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> > >*, _AllocType =
MemAllocator<std::pair<std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >, Element<unsigned
int, SqlObjectDefn, std::basic_string<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > >*> >]



Any comments/suggestions are higly appreciated.

Thanks,
-Kelvin


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux