GCC 4.0 pragma interface/implementation regression with templates

Peter Soetens peter.soetens@mech.kuleuven.ac.be
Tue Mar 22 21:30:00 GMT 2005


Hello,

The attached implementation/header issues a warning when

$ gcc-4.0    -c -o test_undefined.o test_undefined.cpp
undefined_constructor.hpp:13: warning: inline function 'Base::Base()' used but 
never defined

This does not happen with 3.x compilers. If you remove the
#pragma interface, the warning disapears. It does also not happen
if you write 
#pragma implementation "undefined_constructor.hpp"
in the cpp file.

It apears to be triggered when using a template class with a base class.
I had similar warnings for a missing destructor.

Peter Soetens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: undefined_constructor.hpp
Type: text/x-c++hdr
Size: 106 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20050322/70caa9e1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_undefined.cpp
Type: text/x-c++src
Size: 98 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20050322/70caa9e1/attachment-0001.bin>


More information about the Gcc mailing list