Skip to content

Commit fc34fef

Browse files
Update checkclass.cpp
1 parent 32f052d commit fc34fef

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

lib/checkclass.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,19 @@ void CheckClass::constructors()
244244
if (!var.isPointer() && !var.isPointerArray() && var.isClass() && func.type == FunctionType::eConstructor) {
245245
// Unknown type so assume it is initialized
246246
if (!var.type()) {
247-
if (var.isStlType() && var.valueType() && var.valueType()->containerTypeToken && var.getTypeName() == "std::array") {
248-
const Token* ctt = var.valueType()->containerTypeToken;
249-
if (!ctt->isStandardType() &&
250-
(!ctt->type() || ctt->type()->needInitialization != Type::NeedInitialization::True) &&
251-
!mSettings->library.podtype(ctt->str())) // TODO: handle complex type expression
247+
if (var.isStlType() && var.valueType() && var.valueType()->containerTypeToken) {
248+
if (var.valueType()->type == ValueType::Type::ITERATOR)
249+
{
250+
// needs initialization
251+
}
252+
else if (var.getTypeName() == "std::array") {
253+
const Token* ctt = var.valueType()->containerTypeToken;
254+
if (!ctt->isStandardType() &&
255+
(!ctt->type() || ctt->type()->needInitialization != Type::NeedInitialization::True) &&
256+
!mSettings->library.podtype(ctt->str())) // TODO: handle complex type expression
257+
continue;
258+
}
259+
else
252260
continue;
253261
}
254262
else

0 commit comments

Comments
 (0)