Fix crash in checkclass.cpp (#3104)

This commit is contained in:
Ken-Patrick Lehrmann 2021-01-31 12:14:10 +01:00 committed by GitHub
parent 4e35f19659
commit 96ea5a432f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -170,7 +170,7 @@ void CheckClass::constructors()
if (usage[count].assign || usage[count].init || var.isStatic()) if (usage[count].assign || usage[count].init || var.isStatic())
continue; continue;
if (var.valueType()->pointer == 0 && var.type() && var.type()->needInitialization == Type::NeedInitialization::False && var.type()->derivedFrom.empty()) if (var.valueType() && var.valueType()->pointer == 0 && var.type() && var.type()->needInitialization == Type::NeedInitialization::False && var.type()->derivedFrom.empty())
continue; continue;
if (var.isConst() && func.isOperator()) // We can't set const members in assignment operator if (var.isConst() && func.isOperator()) // We can't set const members in assignment operator