Fully reverting r203236 -- it seems the only bots that are happy are the MSVC bots.
llvm-svn: 203237
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 0b83427..2d35d5c 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -12723,41 +12723,48 @@
FindCXXThisExpr Finder(*this);
// Check attributes.
- for (auto A : Method->attrs()) {
+ for (Decl::attr_iterator A = Method->attr_begin(), AEnd = Method->attr_end();
+ A != AEnd; ++A) {
// FIXME: This should be emitted by tblgen.
Expr *Arg = 0;
ArrayRef<Expr *> Args;
- if (auto G = dyn_cast<GuardedByAttr>(A))
+ if (GuardedByAttr *G = dyn_cast<GuardedByAttr>(*A))
Arg = G->getArg();
- else if (auto G = dyn_cast<PtGuardedByAttr>(A))
+ else if (PtGuardedByAttr *G = dyn_cast<PtGuardedByAttr>(*A))
Arg = G->getArg();
- else if (auto AA = dyn_cast<AcquiredAfterAttr>(A))
+ else if (AcquiredAfterAttr *AA = dyn_cast<AcquiredAfterAttr>(*A))
Args = ArrayRef<Expr *>(AA->args_begin(), AA->args_size());
- else if (auto AB = dyn_cast<AcquiredBeforeAttr>(A))
+ else if (AcquiredBeforeAttr *AB = dyn_cast<AcquiredBeforeAttr>(*A))
Args = ArrayRef<Expr *>(AB->args_begin(), AB->args_size());
- else if (auto ELF = dyn_cast<ExclusiveLockFunctionAttr>(A))
+ else if (ExclusiveLockFunctionAttr *ELF
+ = dyn_cast<ExclusiveLockFunctionAttr>(*A))
Args = ArrayRef<Expr *>(ELF->args_begin(), ELF->args_size());
- else if (auto SLF = dyn_cast<SharedLockFunctionAttr>(A))
+ else if (SharedLockFunctionAttr *SLF
+ = dyn_cast<SharedLockFunctionAttr>(*A))
Args = ArrayRef<Expr *>(SLF->args_begin(), SLF->args_size());
- else if (auto ETLF = dyn_cast<ExclusiveTrylockFunctionAttr>(A)) {
+ else if (ExclusiveTrylockFunctionAttr *ETLF
+ = dyn_cast<ExclusiveTrylockFunctionAttr>(*A)) {
Arg = ETLF->getSuccessValue();
Args = ArrayRef<Expr *>(ETLF->args_begin(), ETLF->args_size());
- } else if (auto STLF = dyn_cast<SharedTrylockFunctionAttr>(A)) {
+ } else if (SharedTrylockFunctionAttr *STLF
+ = dyn_cast<SharedTrylockFunctionAttr>(*A)) {
Arg = STLF->getSuccessValue();
Args = ArrayRef<Expr *>(STLF->args_begin(), STLF->args_size());
- } else if (auto UF = dyn_cast<UnlockFunctionAttr>(A))
+ } else if (UnlockFunctionAttr *UF = dyn_cast<UnlockFunctionAttr>(*A))
Args = ArrayRef<Expr *>(UF->args_begin(), UF->args_size());
- else if (auto LR = dyn_cast<LockReturnedAttr>(A))
+ else if (LockReturnedAttr *LR = dyn_cast<LockReturnedAttr>(*A))
Arg = LR->getArg();
- else if (auto LE = dyn_cast<LocksExcludedAttr>(A))
+ else if (LocksExcludedAttr *LE = dyn_cast<LocksExcludedAttr>(*A))
Args = ArrayRef<Expr *>(LE->args_begin(), LE->args_size());
- else if (auto RC = dyn_cast<RequiresCapabilityAttr>(A))
+ else if (RequiresCapabilityAttr *RC
+ = dyn_cast<RequiresCapabilityAttr>(*A))
Args = ArrayRef<Expr *>(RC->args_begin(), RC->args_size());
- else if (auto AC = dyn_cast<AcquireCapabilityAttr>(A))
+ else if (AcquireCapabilityAttr *AC = dyn_cast<AcquireCapabilityAttr>(*A))
Args = ArrayRef<Expr *>(AC->args_begin(), AC->args_size());
- else if (auto AC = dyn_cast<TryAcquireCapabilityAttr>(A))
- Args = ArrayRef<Expr *>(AC->args_begin(), AC->args_size());
- else if (auto RC = dyn_cast<ReleaseCapabilityAttr>(A))
+ else if (TryAcquireCapabilityAttr *AC
+ = dyn_cast<TryAcquireCapabilityAttr>(*A))
+ Args = ArrayRef<Expr *>(AC->args_begin(), AC->args_size());
+ else if (ReleaseCapabilityAttr *RC = dyn_cast<ReleaseCapabilityAttr>(*A))
Args = ArrayRef<Expr *>(RC->args_begin(), RC->args_size());
if (Arg && !Finder.TraverseStmt(Arg))