Fixed #420 (WarningOldStylePointerCast() needs a test case)
This commit is contained in:
parent
3da3c74f6f
commit
12c9f09780
|
@ -46,6 +46,7 @@ public:
|
|||
|
||||
if (settings->_checkCodingStyle)
|
||||
{
|
||||
checkOther.WarningOldStylePointerCast();
|
||||
checkOther.CheckUnsignedDivision();
|
||||
checkOther.CheckCharVariable();
|
||||
}
|
||||
|
@ -57,7 +58,6 @@ public:
|
|||
|
||||
if (settings->_checkCodingStyle)
|
||||
{
|
||||
checkOther.WarningOldStylePointerCast();
|
||||
checkOther.WarningRedundantCode();
|
||||
checkOther.WarningIf();
|
||||
checkOther.CheckVariableScope();
|
||||
|
|
|
@ -450,6 +450,14 @@ private:
|
|||
|
||||
void oldStylePointerCast()
|
||||
{
|
||||
checkOldStylePointerCast("class Base;\n"
|
||||
"void foo()\n"
|
||||
"{\n"
|
||||
" Base * b = (Base *) derived;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:4]: (style) C-style pointer casting\n", errout.str());
|
||||
|
||||
|
||||
checkOldStylePointerCast("class B;\n"
|
||||
"class A\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue