From: Aaron Ballman Date: Fri, 15 Aug 2014 12:29:39 +0000 (+0000) Subject: Adding const-qualifiers to auto declarations. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=547f9d8966fd64af555900ba4fd3d52a40ac9b5a;p=clang Adding const-qualifiers to auto declarations. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215704 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ThreadSafety.cpp b/lib/Analysis/ThreadSafety.cpp index 469e79be72..f2746cba8c 100644 --- a/lib/Analysis/ThreadSafety.cpp +++ b/lib/Analysis/ThreadSafety.cpp @@ -1337,10 +1337,10 @@ void BuildLockset::checkAccess(const Expr *Exp, AccessKind AK) { if (Analyzer->Handler.issueBetaWarnings()) { // Local variables of reference type cannot be re-assigned; // map them to their initializer. - while (auto *DRE = dyn_cast(Exp)) { - auto *VD = dyn_cast(DRE->getDecl()->getCanonicalDecl()); + while (const auto *DRE = dyn_cast(Exp)) { + const auto *VD = dyn_cast(DRE->getDecl()->getCanonicalDecl()); if (VD && VD->isLocalVarDecl() && VD->getType()->isReferenceType()) { - if (auto *E = VD->getInit()) { + if (const auto *E = VD->getInit()) { Exp = E; continue; }