Hi,
I think we hit a compiler bug when compiling ( --abi=eabi -O3) a templated class with a function that is inlined in the same compilation unit.
Consider this minimal example:
template <unsigned int SIZE> template class Tmpl { public: // clear the complete log messge queue void fun(); }; template void Tmpl::fun() { } template class Tmpl<16>; Tmpl<16> gErrors; int init_fun() { gErrors.fun(); // commenting this line out makes it compile correctly return 0; } int i = init_fun();
When compiling (TI Code Generation Tools 7.4.14) this with the following command, the symbols for the Tmpl<16>::fun() function (_ZN4TmplILj16EE3funEv) are not generated:
cl6x.exe -c --abi=eabi -O3 myfile.cpp
I inspect the resulting myfile.obj file with the nm6x-tool.
As soon as I comment out the line mentioned above or compile with lower optimization settings (e.g. -O0), the generated object file contains the symbols for this function (like expected).
00000000 ? _ZN4TmplILj16EE3funEv 00000000 T _ZN4TmplILj16EE3funEv
Can you please confirm that this is a bug in the compiler?
Kind regards,
Roman