Fixed #6234 (FP : shift by too many bits is undefined on a QT container)

This commit is contained in:
Daniel Marjamäki 2014-10-23 06:52:19 +02:00
parent 71c5d4bd60
commit 4483c3e820
2 changed files with 7 additions and 1 deletions

View File

@ -124,7 +124,7 @@ void CheckType::checkTooBigBitwiseShift()
lhsbits = _settings->sizeof_int * 8; lhsbits = _settings->sizeof_int * 8;
break; break;
} }
if (type == var->typeEndToken()) if (type == var->typeEndToken() || type->str() == "<")
break; break;
} }
if (lhsbits == 0) if (lhsbits == 0)

View File

@ -79,6 +79,12 @@ private:
" return (long long)x << 40;\n" " return (long long)x << 40;\n"
"}",&settings); "}",&settings);
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
check("void foo() {\n"
" QList<int> someList;\n"
" someList << 300;\n"
"}", &settings);
ASSERT_EQUALS("", errout.str());
} }
void checkIntegerOverflow() { void checkIntegerOverflow() {