The following code generates the error

/home/stefan/fs.cc:11: error: template-id ‘foo<>’ for ‘void foo(int)’ does not
match any template declaration
/home/stefan/fs.cc:11: error: invalid function declaration 


as it doesn't seem to match 'Tag<int>::tag' against 'Tag<A>::tag' but the
substituted 'int' directly.

---

template <typename A> struct Tag { typedef int type;};

template <typename A>
void
foo(typename Tag<A>::type t);

template <>
void
foo(Tag<int>::type t) {} 

---


-- 
           Summary: g++ seems to substitute template parameter too early
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: seefeld at sympatico dot ca


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

Reply via email to