With the following code, the compiler can't match the function template, with a
typedef template argument, when deduction is involved.

template <typename T> struct S
{
        typedef T Type;
};
template <typename T> void F(typename S<T>::Type) {}
int main()
{
        F(int());          // fails
        F(S<int>::Type()); // fails
        F<int>(int());     // succeeds
}

$ g++ -otest test.cpp
test.cpp: In function `int main()':
test.cpp:8: error: no matching function for call to `F(int)'
test.cpp:9: error: no matching function for call to `F(int)'


-- 
           Summary: typedef template in function template argument deduction
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc at david dot osborn dot name
 GCC build triplet: i686-pc-mingw32
  GCC host triplet: i686-pc-mingw32
GCC target triplet: i686-pc-mingw32


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

Reply via email to