------- Comment #6 from bangerth at dealii dot org  2005-10-04 02:03 -------
Confirmed. A redux is here:
----------------------
template<typename T>
struct O {
  struct I;
};

template<>
struct O<int>::I
{
    I();
};

O<int>::I::I() {}
------------------------------
g/x> /home/bangerth/bin/gcc-3.4.5-pre/bin/c++ -c x.cc
g/x> /home/bangerth/bin/gcc-4.0*/bin/c++ -c x.cc
x.cc:12: error: explicit specialization of &#8216;O<int>::I<int>::I()&#8217;
must be introduced by &#8216;template <>&#8217;
x.cc:12: error: template-id &#8216;I<>&#8217; for
&#8216;O<int>::I<int>::I()&#8217; does not match any template declaration
x.cc:12: error: invalid function declaration

Not only is gcc wrong to reject the code, but to use O<int>::I<int> when I
is in fact not a template at all also reveals that something is going wrong.

This is a 4.0/4.1 regression.

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2005-10-04 02:03:46
               date|                            |
            Summary|Forward declaration of class|[4.0/4.1 Regression] Rejects
                   |in template class           |definition of member of
                   |                            |specialized inner class
   Target Milestone|---                         |4.0.3


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

Reply via email to