This commit has its date moved to earlier to reflect when the work was completed, as I forgot to actually make the commit until 2 minutes after midnight :/. It partially fixed a bug where ADT requires equality for its member types but won't use templated equality to be if there isn't a regular equality operator (not templated) it always returns false

This commit is contained in:
Nathan Braswell
2016-01-22 23:59:59 -05:00
parent 8c5bf36433
commit fc343ceea8
4 changed files with 41 additions and 21 deletions

View File

@@ -358,7 +358,12 @@ std::pair<std::string, std::string> CGenerator::generateTranslationUnit(std::str
// Remember, we don't destruct copy_constructTemporary because the function will do that
functionDefinitions += "}\n";
} else {
functionDefinitions += " equal = this->" + prefixed_option_name + " == in->" + prefixed_option_name + ";\n}\n";
// if we're an object type but don't define an equality function (or, as is a current bug, that function is a template)
// we just say always false/unequal
if (child->getDataRef()->valueType->typeDefinition)
functionDefinitions += " equal = false;\n}\n";
else
functionDefinitions += " equal = this->" + prefixed_option_name + " == in->" + prefixed_option_name + ";\n}\n";
}
}
}