Trac ticket #7798 was fixed in 3f1e2b4270
(More conservative fallback for function overload matching). Add a test
to avoid regressions.
This commit is contained in:
parent
b466415bb4
commit
b970606c93
|
@ -60,6 +60,7 @@ private:
|
||||||
TEST_CASE(checkComparisonOfFuncReturningBool4);
|
TEST_CASE(checkComparisonOfFuncReturningBool4);
|
||||||
TEST_CASE(checkComparisonOfFuncReturningBool5);
|
TEST_CASE(checkComparisonOfFuncReturningBool5);
|
||||||
TEST_CASE(checkComparisonOfFuncReturningBool6);
|
TEST_CASE(checkComparisonOfFuncReturningBool6);
|
||||||
|
TEST_CASE(checkComparisonOfFuncReturningBool7); // #7798 overloaded functions
|
||||||
TEST_CASE(checkComparisonOfBoolWithBool);
|
TEST_CASE(checkComparisonOfBoolWithBool);
|
||||||
|
|
||||||
// Converting pointer addition result to bool
|
// Converting pointer addition result to bool
|
||||||
|
@ -726,6 +727,19 @@ private:
|
||||||
ASSERT_EQUALS("", errout.str());
|
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() {
|
void checkComparisonOfBoolWithBool() {
|
||||||
const char code[] = "void f(){\n"
|
const char code[] = "void f(){\n"
|
||||||
" int temp = 4;\n"
|
" int temp = 4;\n"
|
||||||
|
|
Loading…
Reference in New Issue