parent
b729c4a126
commit
edd86c0b0a
|
@ -246,6 +246,7 @@ private:
|
||||||
TEST_CASE(shadowVariables);
|
TEST_CASE(shadowVariables);
|
||||||
TEST_CASE(knownArgument);
|
TEST_CASE(knownArgument);
|
||||||
TEST_CASE(knownArgumentHiddenVariableExpression);
|
TEST_CASE(knownArgumentHiddenVariableExpression);
|
||||||
|
TEST_CASE(knownArgumentTernaryOperator);
|
||||||
TEST_CASE(checkComparePointers);
|
TEST_CASE(checkComparePointers);
|
||||||
|
|
||||||
TEST_CASE(unusedVariableValueTemplate); // #8994
|
TEST_CASE(unusedVariableValueTemplate); // #8994
|
||||||
|
@ -9287,6 +9288,18 @@ private:
|
||||||
"[test.cpp:7]: (style) Argument '0*x' to function dostuff is always 0. Constant literal calculation disable/hide variable expression 'x'.\n", errout.str());
|
"[test.cpp:7]: (style) Argument '0*x' to function dostuff is always 0. Constant literal calculation disable/hide variable expression 'x'.\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void knownArgumentTernaryOperator() { // #10374
|
||||||
|
check("void f(bool a, bool b) {\n"
|
||||||
|
" const T* P = nullptr; \n"
|
||||||
|
" long N = 0; \n"
|
||||||
|
" const bool c = foo(); \n"
|
||||||
|
" bar(P, N); \n"
|
||||||
|
" if (c ? a : b)\n"
|
||||||
|
" baz(P, N); \n"
|
||||||
|
"}");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
}
|
||||||
|
|
||||||
void checkComparePointers() {
|
void checkComparePointers() {
|
||||||
check("int f() {\n"
|
check("int f() {\n"
|
||||||
" const int foo[1] = {0};\n"
|
" const int foo[1] = {0};\n"
|
||||||
|
|
Loading…
Reference in New Issue