This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/8961: template template parameter works with 2.95; 3.2.1 reports error.
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, helm at fs dot tum dot de, nobody at gcc dot gnu dot org
- Date: 16 Dec 2002 16:33:52 -0000
- Subject: Re: c++/8961: template template parameter works with 2.95; 3.2.1 reports error.
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, helm at fs dot tum dot de, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: template template parameter works with 2.95; 3.2.1 reports error.
State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Mon Dec 16 08:33:50 2002
State-Changed-Why:
When you write in your partial specialization
template<int rows>
struct Matrix<rows,1> : Matrix_Base<rows,1,Matrix> {
Matrix() : Matrix_Base<rows,1,Matrix>() {};
^^^^^^
The unqualified use of "Matrix" in the template list of the
base class initializer refers to the present class (with
all template arguments (just in the same way as you write
the name of the constructor as Matrix instead of
Matrix<rows,1>. If you want to refer to the global
template (without fixed template arguments), then you
have to write ::Matrix, which makes your code compile.
By the way, writing
template<int rows, int cols, template<int rows, int cols> class C>
is asking for trouble, since you use the same identifier
names (rows, cols) twice. Use different names, or omit
them in the template template parameter at all.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8961