Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
danmar committed Sep 30, 2024
1 parent 65e2e5d commit a5bdec0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/checkautovariables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ void CheckAutoVariables::checkVarLifetimeScope(const Token * start, const Token
errorReturnReference(tok, lt.errorPath, lt.inconclusive);
break;
}
if (isDeadTemporary(lt.token, nullptr, &mSettings->library)) {
if (isDeadTemporary(lt.token, nullptr, &mSettings->library) && lt.token->variable() && lt.token->variable()->isReference()) {
errorReturnTempReference(tok, lt.errorPath, lt.inconclusive);
break;
}
Expand Down

0 comments on commit a5bdec0

Please sign in to comment.