This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7166: Non-type template instantiation fails for pointer types
- From: nathan at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, ofv at wanadoo dot es
- Date: 30 Jun 2002 09:57:17 -0000
- Subject: Re: c++/7166: Non-type template instantiation fails for pointer types
- Reply-to: nathan at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, ofv at wanadoo dot es, gcc-gnats at gcc dot gnu dot org
Synopsis: Non-type template instantiation fails for pointer types
State-Changed-From-To: open->closed
State-Changed-By: nathan
State-Changed-When: Sun Jun 30 02:57:04 2002
State-Changed-Why:
not a bug. Like the error says, you are attempting to
instantiate a template on a non-externally visible object
(the thing pointer to *by* strPointer). The array case
works becuase of array->pointer decay - the thing pointed
to is the first array element, and that does have external
linkage. May be you mean to write
template <char const *&r> class Foo {};
which would be acceptable for the first case, as then you're
binding to the pointer variable.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7166