Following snippet causes compiler to produce internal compiler error:

typedef void F(void);
template <typename T> struct S 
{
    static F f;
};
template class S<int>;
template <class T> void S<T>::f(void)
{}

I'm not sure it is valid to define S<T>::f() after instantiating the class, but
even if not, an ICE is not a proper response for a compiler in any case. #24511
mentions that all member templates (template members?) must be defined before
explicit instantiation although I don't read that per se in my copy of the
standard.

There might be a vague relation to #24791 if there is g++-internal confusion
about f being a static data member. This confusion might be exhibited in #33972
as well.

Ciao.
Vincent.


-- 
           Summary: ICE on template class member function definition after
                    explciit template class instantation
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zweije at xs4all dot nl
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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

Reply via email to