Index: lib/StaticAnalyzer/Core/CoreEngine.cpp =================================================================== --- lib/StaticAnalyzer/Core/CoreEngine.cpp +++ lib/StaticAnalyzer/Core/CoreEngine.cpp @@ -223,8 +223,12 @@ // Get return statement.. const ReturnStmt *RS = nullptr; if (!L.getSrc()->empty()) { - if (Optional LastStmt = L.getSrc()->back().getAs()) { + CFGElement LastElement = L.getSrc()->back(); + if (Optional LastStmt = LastElement.getAs()) { RS = dyn_cast(LastStmt->getStmt()); + } else if (Optional AutoDtor = + LastElement.getAs()) { + RS = dyn_cast(AutoDtor->getTriggerStmt()); } }