[Bug c++/21534] New: Declaration in wrong namespace not rejected
bangerth at dealii dot org
gcc-bugzilla@gcc.gnu.org
Thu May 12 17:52:00 GMT 2005
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
More information about the Gcc-bugs
mailing list