[LLVMbugs] [Bug 8173] clang++ (rev. 114175) fails inference of struct type template param from pointer to overloaded member function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Oct 9 14:40:15 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=8173

Douglas Gregor <dgregor at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from Douglas Gregor <dgregor at apple.com> 2011-10-09 16:40:14 CDT ---
Clang is correct here, per C++0x [temp.deduct.call]p6, which states that

  - 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.

For the call to the "connect" function, this matters for the parameter

  ReturnType (MemberObj:: *fn) (Arg1)

which is matched against the argument

  &B::slot

Note that deduction succeeds for both "slot" overloads, so this parameter is
considered a non-deduced context. Hence, there is nothing left to deduce
MemberObj.

Note that EDG agrees with Clang's interpretation here. I don't know what GCC is
doing to accept this code.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list