Bug 1783374 - Adjust RefCountedInsideLambdaChecker to clang trunk changes. r=andi

`getCapturedVar()` now returns a `ValueDecl`.
(127bf44385)

Differential Revision: https://phabricator.services.mozilla.com/D154046
This commit is contained in:
Mike Hommey 2022-08-10 08:14:06 +00:00
Родитель 4119f877a2
Коммит b415d31f15
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -90,7 +90,7 @@ void RefCountedInsideLambdaChecker::check(
// "Smart Pointer" somehow?
if (!StrongRefToThisCaptured && Capture.capturesVariable() &&
Capture.getCaptureKind() == LCK_ByCopy) {
const VarDecl *Var = Capture.getCapturedVar();
const VarDecl *Var = dyn_cast<VarDecl>(Capture.getCapturedVar());
if (Var->hasInit()) {
const Stmt *Init = Var->getInit();
@ -119,7 +119,7 @@ void RefCountedInsideLambdaChecker::check(
// pointers.
for (const LambdaCapture &Capture : Lambda->captures()) {
if (Capture.capturesVariable()) {
const VarDecl *Var = Capture.getCapturedVar();
const VarDecl *Var = dyn_cast<VarDecl>(Capture.getCapturedVar());
QualType Pointee = Var->getType()->getPointeeType();
if (!Pointee.isNull() && isClassRefCounted(Pointee) &&
!IsKnownLive(Var)) {