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]

c++/692: Explicit instantiation of template outside namespace rejected



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

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