Skip to content

Commit 4754a7e

Browse files
Update valueflow.cpp
1 parent ca62d2d commit 4754a7e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/valueflow.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1948,7 +1948,10 @@ static bool isLifetimeBorrowed(const ValueType *vt, const ValueType *vtParent)
19481948
return true;
19491949
if (vtParent->pointer < vt->pointer && vtParent->isIntegral())
19501950
return true;
1951-
if (vtParent->str() == vt->str())
1951+
std::string vtParentStr = vtParent->str();
1952+
if (startsWith(vtParentStr, "const ") // HACK: assignment to const
1953+
vtParentStr.erase(0, 6);
1954+
if (vtParentStr == vt->str())
19521955
return true;
19531956
}
19541957

0 commit comments

Comments
 (0)