Fixed #6234 (FP : shift by too many bits is undefined on a QT container)
This commit is contained in:
parent
71c5d4bd60
commit
4483c3e820
|
@ -124,7 +124,7 @@ void CheckType::checkTooBigBitwiseShift()
|
|||
lhsbits = _settings->sizeof_int * 8;
|
||||
break;
|
||||
}
|
||||
if (type == var->typeEndToken())
|
||||
if (type == var->typeEndToken() || type->str() == "<")
|
||||
break;
|
||||
}
|
||||
if (lhsbits == 0)
|
||||
|
|
|
@ -79,6 +79,12 @@ private:
|
|||
" return (long long)x << 40;\n"
|
||||
"}",&settings);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void foo() {\n"
|
||||
" QList<int> someList;\n"
|
||||
" someList << 300;\n"
|
||||
"}", &settings);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void checkIntegerOverflow() {
|
||||
|
|
Loading…
Reference in New Issue