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;
|
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)
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue