fix forcetype for template instantiations

This commit is contained in:
David Rose 2010-02-28 03:29:03 +00:00
parent 2941d95466
commit 882b544805
4 changed files with 13 additions and 3 deletions

View File

@ -34,6 +34,10 @@ CPPType(const CPPFile &file) :
CPPDeclaration(file)
{
_declaration = (CPPTypeDeclaration *)NULL;
// This is set true by interrogate when the "forcetype" keyword is
// used.
_forcetype = false;
}
////////////////////////////////////////////////////////////////////

View File

@ -77,6 +77,7 @@ public:
static string get_preferred_name_for(const CPPType *type);
CPPTypeDeclaration *_declaration;
bool _forcetype;
protected:
typedef set<CPPType *, CPPTypeCompare> Types;

View File

@ -145,6 +145,7 @@ do_command(const string &command, const string &params) {
nout << "Unknown type: forcetype " << params << "\n";
} else {
type = type->resolve_type(&parser, &parser);
type->_forcetype = true;
_forcetype.insert(type->get_local_name(&parser));
}

View File

@ -1704,11 +1704,15 @@ bool TypeManager::IsLocal(CPPType *in_type)
// A local means it was compiled in this scope of work..
// IE a should actualy generate code for this objects....
CPPType *base_type = resolve_type(unwrap(in_type));
if (base_type->_forcetype) {
return true;
}
if(base_type->_file._source == CPPFile::S_local && !base_type->is_incomplete())
return true;
if (base_type->_file._source == CPPFile::S_local && !base_type->is_incomplete()) {
return true;
}
return false;
return false;
/*