]> granicus.if.org Git - clang/commitdiff
Adding const-qualifiers to auto declarations. NFC.
authorAaron Ballman <aaron@aaronballman.com>
Fri, 15 Aug 2014 12:29:39 +0000 (12:29 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Fri, 15 Aug 2014 12:29:39 +0000 (12:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215704 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ThreadSafety.cpp

index 469e79be7242f494e9a6c3d8167c2bb04bc0e8a7..f2746cba8cd30b322341b03eeda39da8a85f5634 100644 (file)
@@ -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<DeclRefExpr>(Exp)) {
-      auto *VD = dyn_cast<VarDecl>(DRE->getDecl()->getCanonicalDecl());
+    while (const auto *DRE = dyn_cast<DeclRefExpr>(Exp)) {
+      const auto *VD = dyn_cast<VarDecl>(DRE->getDecl()->getCanonicalDecl());
       if (VD && VD->isLocalVarDecl() && VD->getType()->isReferenceType()) {
-        if (auto *E = VD->getInit()) {
+        if (const auto *E = VD->getInit()) {
           Exp = E;
           continue;
         }