This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13917] New: template function not emitted.
- From: "carlo at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jan 2004 05:56:15 -0000
- Subject: [Bug c++/13917] New: template function not emitted.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Version 3.3 and higher do not emit code.
All lower versions also don't, but give an error.
Code snippet:
#if 0
typedef int type_nt; // This compiles
type_nt const string = 0;
#else
enum type_nt { // This doesn't emit the template function.
string
};
#endif
template<type_nt type, typename T>
struct PX {
T const* M_ptr;
PX(T const* ptr) : M_ptr(ptr) { }
template<type_nt _type, typename _T>
friend void g(PX<_type, _T> const& p);
};
template<int type, typename T>
void g(PX<type, T> const& p) { }
void f()
{
PX<string, char> p("hello");
g(p);
}
--
Summary: template function not emitted.
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: carlo at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13917