This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17045] New: conflict between function template and class with same name
- From: "gccbugs at contacts dot eelis dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Aug 2004 03:08:44 -0000
- Subject: [Bug c++/17045] New: conflict between function template and class with same name
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code is rejected by GCC 3.4.1 :
template <typename T> void f (T) {}
template <typename T> void g () { f(T()); }
namespace N
{
struct f {};
}
void h () { g<N::f>(); }
Error:
t.cpp: In function `void g() [with T = N::f]':
t.cpp:10: instantiated from here
t.cpp:7: error: `struct N::f' is not a function,
t.cpp:1: error: conflict with `template<class T> void f(T)'
t.cpp:3: error: in call to `f'
Comeau 4.3.3 accepts the code.
--
Summary: conflict between function template and class with same
name
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gccbugs at contacts dot eelis dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17045