c++/7033: [2003-01-22] Matching of template patterns

Wolfgang Bangerth bangerth@ticam.utexas.edu
Thu Jan 23 03:05:00 GMT 2003


This report can be reduced to the following snippet: 
------------------------------
template <typename, typename> struct S;

template <template <typename> class C,
          typename T,
          typename V>
struct S<C<T>,typename C<T>::template it<V> > {
    typedef int it;
};


template <typename> struct U {
    template <typename> struct it {
        it (int);
    };
};

int main() {
  typedef U<int>   c2i;
  S<c2i,c2i::it<int> >::it it;
};
-------------------------------

The question is: will the template list in the last line match the 
specialization of S or not. gcc says "no" and complains about the 
incomplete general template S when creating the variable.

FWIW, icc agrees with gcc here. I have no opinion.

W.

-------------------------------------------------------------------------
Wolfgang Bangerth             email:            bangerth@ticam.utexas.edu
                              www: http://www.ticam.utexas.edu/~bangerth/




More information about the Gcc-bugs mailing list