The following test case is rejected by Comeau but accepted by GCC:

template <typename T>
struct outer {
  template <typename U>
  T search(U, T);
};

template <typename T>
template <typename U>
T outer<T>::template search (U, T)
{
  return T ();
}

int
main ()
{
  int x = 0;
  int v = 0;
  outer<int> s;
  s.search (v, x);
}


"ComeauTest.c", line 9: error: an explicit template argument list is not
allowed on
          this declaration
  T outer<T>::template search (U, T)
    ^

It does not like the extra template keyword in "T outer<T>::template search (U,
T)".


-- 
           Summary: GCC accepts template keyword where Comeau rejects it.
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: v dot haisman at sh dot cvut dot cz
 GCC build triplet: amd64-unknown-freebsd7.1
  GCC host triplet: amd64-unknown-freebsd7.1
GCC target triplet: amd64-unknown-freebsd7.1


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

Reply via email to