[Bug c++/29252] Strange "No matching function for call" compilation error with G++ 4.1

2006-09-27 Thread bangerth at dealii dot org


--- Comment #4 from bangerth at dealii dot org  2006-09-28 06:06 ---
I think the error message is perfectly clear: it says that there is no
function
   foo (X)
but that there is a function that provides
   foo (X&)

We've gone through this many times that there is no way to say "see, you
try to bind an rvalue to a reference, this isn't working" because the
overload set of candidates may be larger than the single function above
and there is no way to guess what the user may mean.

So closing...

W.


-- 

bangerth at dealii dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29252



[Bug c++/29252] Strange "No matching function for call" compilation error with G++ 4.1

2006-09-27 Thread pinskia at gcc dot gnu dot org


--- Comment #3 from pinskia at gcc dot gnu dot org  2006-09-28 01:56 ---
The error message is broken but this is invalid code as you cannot bind a
temporary to a reference argument.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29252



[Bug c++/29252] Strange "No matching function for call" compilation error with G++ 4.1

2006-09-27 Thread pinskia at gcc dot gnu dot org


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

   Severity|critical|normal


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29252



[Bug c++/29252] Strange "No matching function for call" compilation error with G++ 4.1

2006-09-27 Thread yuanfei8077 at gmail dot com


--- Comment #2 from yuanfei8077 at gmail dot com  2006-09-28 01:50 ---
Hi,

For your convinence, the following is the reproduction code.

Many Thanks,
-Kelvin


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

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


Repro code
===
template  class MemAllocator{};

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

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

return 0;
}


-- 

yuanfei8077 at gmail dot com changed:

   What|Removed |Added

 Status|WAITING |UNCONFIRMED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29252



[Bug c++/29252] Strange "No matching function for call" compilation error with G++ 4.1

2006-09-27 Thread bangerth at dealii dot org


--- Comment #1 from bangerth at dealii dot org  2006-09-27 15:46 ---
You didn't show us the code that generated the problem. We can't do anything
without that. Please read
  http://gcc.gnu.org/bugs.html
for more information.

Best
  W.


-- 

bangerth at dealii dot org changed:

   What|Removed |Added

 CC||bangerth at dealii dot org
 Status|UNCONFIRMED |WAITING
Summary|Strange "No matching|Strange "No matching
   |function for call"  |function for call"
   |compilation error with G++  |compilation error with G++
   |4.1 |4.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29252