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

[Bug c++/5458] address of overloaded template function as argument for template



https://gcc.gnu.org/bugzilla/show_bug.cgi?id=5458

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID
      Known to fail|4.2.0                       |

--- Comment #18 from Jason Merrill <jason at gcc dot gnu.org> ---
The compiler is following the standard.  C++11 and up say,

When P is a function type, pointer to function type, or pointer to member
function type:
— If the argument is an overload set containing one or more function templates,
the parameter is treated as a non-deduced context.
— If the argument is an overload set (not containing function templates), trial
argument deduction is attempted using each of the members of the set. If
deduction succeeds for only one of the overload set members, that member is
used as the argument value for the deduction. If deduction succeeds for more
than one member of the overload set the parameter is treated as a non-deduced
context.

So indeed, adding a function template to the overload set means no deduction is
done, according to the first bullet.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply to: