This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC 4.0 pragma interface/implementation regression with templates
- From: Peter Soetens <peter dot soetens at mech dot kuleuven dot ac dot be>
- To: gcc at gnu dot org
- Date: Tue, 22 Mar 2005 20:54:20 +0100
- Subject: GCC 4.0 pragma interface/implementation regression with templates
- Organization: KU Leuven
- Reply-to: peter dot soetens at mech dot kuleuven dot ac dot be
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
#pragma interface
struct Base
{
};
template< class T>
struct Sub
: public Base
{
Sub() {}
};
#pragma implementation
#include "undefined_constructor.hpp"
void foo()
{
Sub<double> sub;
}