Attempt to fix crashes when variable valueType is nullptr. This can happen when decltype is used on unknown type
This commit is contained in:
parent
ad0eb6108b
commit
d383913e1b
|
@ -964,7 +964,9 @@ void CheckClass::initializationListUsage()
|
||||||
const Variable* var = tok->variable();
|
const Variable* var = tok->variable();
|
||||||
if (!var || var->scope() != owner || var->isStatic())
|
if (!var || var->scope() != owner || var->isStatic())
|
||||||
continue;
|
continue;
|
||||||
if (var->isPointer() || var->isReference() || var->isEnumType() || var->valueType()->type > ValueType::Type::ITERATOR)
|
if (var->isPointer() || var->isReference() || var->isEnumType())
|
||||||
|
continue;
|
||||||
|
if (!WRONG_DATA(!var->valueType(), tok) && var->valueType()->type > ValueType::Type::ITERATOR)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// bailout: multi line lambda in rhs => do not warn
|
// bailout: multi line lambda in rhs => do not warn
|
||||||
|
|
Loading…
Reference in New Issue