/// \returns true if derived method can override base method except for the /// name. static bool checkOverrideWithoutName(const ASTContext *Context, const CXXMethodDecl *BaseMD, const CXXMethodDecl *DerivedMD) { if (BaseMD->isStatic() != DerivedMD->isStatic()) return false; if (BaseMD->getType() == DerivedMD->getType()) return true; // Now the function types are not identical. Then check if the return types // are covariant and if the param types are the same. if (!checkOverridingFunctionReturnType(Context, BaseMD, DerivedMD)) return false; return checkParamTypes(BaseMD, DerivedMD); }
void Check_PriorDeclaration_Base::checkProcedureCallAgainstDeclaration( const DeclaredProcedure::shared_ptr& procDec, const AST_ProcedureCall::shared_ptr &stm) const { const AST_BaseExpression::vec_shared_ptr& expressions = stm->expressionParams(); std::string additionalInformation(""); if (!checkParamTypes(procDec, expressions, additionalInformation)) { std::stringstream fmt; fmt << "expression types does not match procedure param types: " << stm->name() << "\n"; fmt << "addtionalInfo: " << additionalInformation; throwException(fmt.str()); } }