[Bug c++/13917] New: template function not emitted.
carlo at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Jan 29 05:56:00 GMT 2004
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
More information about the Gcc-bugs
mailing list