diff --git a/test/testbool.cpp b/test/testbool.cpp index 3c629136a..bd9a3a680 100644 --- a/test/testbool.cpp +++ b/test/testbool.cpp @@ -60,6 +60,7 @@ private: TEST_CASE(checkComparisonOfFuncReturningBool4); TEST_CASE(checkComparisonOfFuncReturningBool5); TEST_CASE(checkComparisonOfFuncReturningBool6); + TEST_CASE(checkComparisonOfFuncReturningBool7); // #7798 overloaded functions TEST_CASE(checkComparisonOfBoolWithBool); // Converting pointer addition result to bool @@ -726,6 +727,19 @@ private: ASSERT_EQUALS("", errout.str()); } + // Integration test + void checkComparisonOfFuncReturningBool7() { // #7798 + check("bool eval(double *) { return false; }\n" + "double eval(char *) { return 1.0; }\n" + "int main(int argc, char *argv[])\n" + "{\n" + " if ( eval(argv[1]) > eval(argv[2]) )\n" + " return 1;\n" + " return 0;\n" + "}"); + ASSERT_EQUALS("", errout.str()); + } + void checkComparisonOfBoolWithBool() { const char code[] = "void f(){\n" " int temp = 4;\n"