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]

[Bug c++/21534] New: Declaration in wrong namespace not rejected


This code isn't rejected, though it should be: 
---------------------------- 
namespace NS 
{ 
  template <typename> void f(); 
} 
 
template <typename> void NS::f (int); 
--------------------------- 
It _is_ rejected if NS::f is not a template. 
 
FWIW, icc says this to the snippet: 
tmp/y> icc -Xc -ansi -c x.cc 
x.cc(6): error: function template "NS::f" may not be redeclared in the current 
scope 
  template <typename> void NS::f (int); 
                           ^ 
W.

-- 
           Summary: Declaration in wrong namespace not rejected
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21534


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