This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/6259: Explicit instantiation of template constructor not allowed
- From: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
- To: gcc-gnats at gcc dot gnu dot org
- Date: 11 Apr 2002 16:55:52 -0000
- Subject: c++/6259: Explicit instantiation of template constructor not allowed
- Reply-to: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
>Number: 6259
>Category: c++
>Synopsis: Explicit instantiation of template constructor not allowed
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Apr 11 09:56:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: all gcc versions
>Organization:
>Environment:
Linux, Sparc
>Description:
The following snippet does not compile, although I believe
that it should. If instead of the constructor a regular
function is used, it works.
-----------------------------------------
template <int dim> struct T {};
struct X {
template <int dim> X (T<dim> &) {};
};
template X::X<> (T<2> &);
-------------------------------------
x.cc:6: `X' is not a template
x.cc:6: ISO C++ forbids declaration of `type name' with no type
x.cc:6: abstract declarator `int (X::)(T<2>&)' used as declaration
x.cc:6: no member function `._0' declared in `X'
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: