------- 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 ‘O<int>::I<int>::I()’ must be introduced by ‘template <>’ x.cc:12: error: template-id ‘I<>’ for ‘O<int>::I<int>::I()’ 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