[cfe-commits] r133731 - /cfe/trunk/lib/AST/DeclBase.cpp
Fariborz Jahanian
fjahanian at apple.com
Thu Jun 23 11:04:27 PDT 2011
Author: fjahanian
Date: Thu Jun 23 13:04:27 2011
New Revision: 133731
URL: http://llvm.org/viewvc/llvm-project?rev=133731&view=rev
Log:
Minor tweak to my last patch per Doug's comment.
Modified:
cfe/trunk/lib/AST/DeclBase.cpp
Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=133731&r1=133730&r2=133731&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Thu Jun 23 13:04:27 2011
@@ -575,11 +575,13 @@
void Decl::dropAttr() {
if (!HasAttrs) return;
AttrVec &Attrs = getASTContext().getDeclAttrs(this);
- for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
+ for (unsigned i = 0, e = Attrs.size(); i != e; /* in loop */) {
if (isa<T>(Attrs[i])) {
Attrs.erase(Attrs.begin() + i);
- --i, --e;
+ --e;
}
+ else
+ ++i;
}
if (Attrs.empty())
HasAttrs = false;
More information about the cfe-commits
mailing list