This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/6259: Explicit instantiation of template constructor not allowed



>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]