This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/692: Explicit instantiation of template outside namespace rejected
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/692: Explicit instantiation of template outside namespace rejected
- From: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
- Date: 26 Oct 2000 12:28:54 -0000
- Reply-To: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
- Resent-Cc: gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, jason at gcc dot gnu dot org
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, wolfgang.bangerth@iwr.uni-heidelberg.de
>Number: 692
>Category: c++
>Synopsis: Explicit instantiation of template outside namespace rejected
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Thu Oct 26 05:36:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
gcc 2.95.2 and present snapshot at CodeSourcery
>Description:
Explicitely instantiating a template outside the namespace
in which it was declared is rejected. However, 14.7.2.2
marks this example as valid. (Besides, the error message
does not tell the problem.)
To see this, compile this:
-----------------------------------
namespace X { template <class T> void f () {}; };
template void X::f<int> ();
-----------------------------------
to obtain
ns.cc:2: `X::f()' should have been declared inside `X'
This happens on both gcc2.95.2 and the present snapshot.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: