parent
ce1fc56e96
commit
31bddb6ae0
|
@ -5002,7 +5002,7 @@
|
||||||
</access>
|
</access>
|
||||||
</container>
|
</container>
|
||||||
<!-- Treat QStringList as QList<QString> since we can't remove the template parameter when we inherit. -->
|
<!-- Treat QStringList as QList<QString> since we can't remove the template parameter when we inherit. -->
|
||||||
<define name="QStringList" value="QList<QString>" />
|
<define name="QStringList" value="QList<QString>"/>
|
||||||
<define name="Q_ARG(type, data)" value="QArgument<type >(#type, data)"/>
|
<define name="Q_ARG(type, data)" value="QArgument<type >(#type, data)"/>
|
||||||
<!-- TODO: Enable when ticket 8479 got fixed
|
<!-- TODO: Enable when ticket 8479 got fixed
|
||||||
<define name="Q_D(Class)" value="Class##Private * const d = d_func()"/>
|
<define name="Q_D(Class)" value="Class##Private * const d = d_func()"/>
|
||||||
|
|
|
@ -674,7 +674,8 @@ void CheckStl::mismatchingContainers()
|
||||||
|
|
||||||
// Lambda is used to escape the nested loops
|
// Lambda is used to escape the nested loops
|
||||||
[&] {
|
[&] {
|
||||||
for (const auto& p : containers) {
|
for (const auto& p : containers)
|
||||||
|
{
|
||||||
const std::vector<ArgIteratorInfo>& cargs = p.second;
|
const std::vector<ArgIteratorInfo>& cargs = p.second;
|
||||||
for (ArgIteratorInfo iter1 : cargs) {
|
for (ArgIteratorInfo iter1 : cargs) {
|
||||||
for (ArgIteratorInfo iter2 : cargs) {
|
for (ArgIteratorInfo iter2 : cargs) {
|
||||||
|
|
|
@ -4550,8 +4550,8 @@ static const ValueFlow::Value* getCompareIntValue(const std::list<ValueFlow::Val
|
||||||
continue;
|
continue;
|
||||||
if (result)
|
if (result)
|
||||||
result = &std::min(value, *result, [&](const ValueFlow::Value& x, const ValueFlow::Value& y) {
|
result = &std::min(value, *result, [&](const ValueFlow::Value& x, const ValueFlow::Value& y) {
|
||||||
return compare(x.intvalue, y.intvalue);
|
return compare(x.intvalue, y.intvalue);
|
||||||
});
|
});
|
||||||
else
|
else
|
||||||
result = &value;
|
result = &value;
|
||||||
}
|
}
|
||||||
|
@ -4561,7 +4561,7 @@ static const ValueFlow::Value* getCompareIntValue(const std::list<ValueFlow::Val
|
||||||
static const ValueFlow::Value* proveLessThan(const std::list<ValueFlow::Value>& values, MathLib::bigint x)
|
static const ValueFlow::Value* proveLessThan(const std::list<ValueFlow::Value>& values, MathLib::bigint x)
|
||||||
{
|
{
|
||||||
const ValueFlow::Value* result = nullptr;
|
const ValueFlow::Value* result = nullptr;
|
||||||
const ValueFlow::Value* maxValue = getCompareIntValue(values, std::greater<MathLib::bigint>{});
|
const ValueFlow::Value* maxValue = getCompareIntValue(values, std::greater<MathLib::bigint> {});
|
||||||
if (maxValue && maxValue->isImpossible() && maxValue->bound == ValueFlow::Value::Bound::Lower) {
|
if (maxValue && maxValue->isImpossible() && maxValue->bound == ValueFlow::Value::Bound::Lower) {
|
||||||
if (maxValue->intvalue <= x)
|
if (maxValue->intvalue <= x)
|
||||||
result = maxValue;
|
result = maxValue;
|
||||||
|
@ -4572,7 +4572,7 @@ static const ValueFlow::Value* proveLessThan(const std::list<ValueFlow::Value>&
|
||||||
static const ValueFlow::Value* proveGreaterThan(const std::list<ValueFlow::Value>& values, MathLib::bigint x)
|
static const ValueFlow::Value* proveGreaterThan(const std::list<ValueFlow::Value>& values, MathLib::bigint x)
|
||||||
{
|
{
|
||||||
const ValueFlow::Value* result = nullptr;
|
const ValueFlow::Value* result = nullptr;
|
||||||
const ValueFlow::Value* minValue = getCompareIntValue(values, std::less<MathLib::bigint>{});
|
const ValueFlow::Value* minValue = getCompareIntValue(values, std::less<MathLib::bigint> {});
|
||||||
if (minValue && minValue->isImpossible() && minValue->bound == ValueFlow::Value::Bound::Upper) {
|
if (minValue && minValue->isImpossible() && minValue->bound == ValueFlow::Value::Bound::Upper) {
|
||||||
if (minValue->intvalue >= x)
|
if (minValue->intvalue >= x)
|
||||||
result = minValue;
|
result = minValue;
|
||||||
|
|
|
@ -3332,7 +3332,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
void alwaysTrueInfer() {
|
void alwaysTrueInfer() {
|
||||||
check("void f(int x) {\n"
|
check("void f(int x) {\n"
|
||||||
" if (x > 5) {\n"
|
" if (x > 5) {\n"
|
||||||
" x++;\n"
|
" x++;\n"
|
||||||
" if (x == 1) {}\n"
|
" if (x == 1) {}\n"
|
||||||
|
@ -3348,7 +3348,7 @@ private:
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:4]: (style) Condition 'x!=1' is always true\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:4]: (style) Condition 'x!=1' is always true\n", errout.str());
|
||||||
|
|
||||||
// #6890
|
// #6890
|
||||||
check("void f(int i) {\n"
|
check("void f(int i) {\n"
|
||||||
" int x = i;\n"
|
" int x = i;\n"
|
||||||
" if (x >= 1) {}\n"
|
" if (x >= 1) {}\n"
|
||||||
|
|
|
@ -580,7 +580,7 @@ private:
|
||||||
" const std::string tp2(a.begin(), a.end());\n"
|
" const std::string tp2(a.begin(), a.end());\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS( // TODO "[test.cpp:2]: (error) Iterators of different containers are used together.\n"
|
ASSERT_EQUALS( // TODO "[test.cpp:2]: (error) Iterators of different containers are used together.\n"
|
||||||
// TODO "[test.cpp:3]: (error) Iterators of different containers are used together.\n"
|
// TODO "[test.cpp:3]: (error) Iterators of different containers are used together.\n"
|
||||||
"[test.cpp:4]: (error) Iterators of different containers 'tp3' and 'a' are used together.\n"
|
"[test.cpp:4]: (error) Iterators of different containers 'tp3' and 'a' are used together.\n"
|
||||||
"[test.cpp:5]: (error) Iterators of different containers 'tp4' and 'b' are used together.\n",
|
"[test.cpp:5]: (error) Iterators of different containers 'tp4' and 'b' are used together.\n",
|
||||||
errout.str());
|
errout.str());
|
||||||
|
|
Loading…
Reference in New Issue