This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47294] New: definition of function template can be explicitly-qualified with a namespace it isn't a member of
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 14 Jan 2011 15:44:28 +0000
- Subject: [Bug c++/47294] New: definition of function template can be explicitly-qualified with a namespace it isn't a member of
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47294
Summary: definition of function template can be
explicitly-qualified with a namespace it isn't a
member of
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: redi@gcc.gnu.org
namespace N
{
void f();
}
template<typename T>
void N::f(T) // ERROR does not match any declaration in N
{
}
int main()
{
::f(0);
}
This is forbidden by [namespace.memdef]p2 but g++ accepts it without error.
EDG, Clang and Sun reject it.
If there isn't an (incompatible) overload of N::f then g++ rejects it.