This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21534] New: Declaration in wrong namespace not rejected
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 May 2005 17:52:17 -0000
- Subject: [Bug c++/21534] New: Declaration in wrong namespace not rejected
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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