summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-06-23 18:04:27 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-06-23 18:04:27 +0000
commitd0cb83a6ab871cf9d00cd94748a9b537f44121e3 (patch)
tree9329e8b67f5831eb090e55783fd67758459670cf /clang/lib/AST
parent72d91dd6e484cd321bf5256b511cb8ec97bb7dff (diff)
downloadbcm5719-llvm-d0cb83a6ab871cf9d00cd94748a9b537f44121e3.tar.gz
bcm5719-llvm-d0cb83a6ab871cf9d00cd94748a9b537f44121e3.zip
Minor tweak to my last patch per Doug's comment.
llvm-svn: 133731
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/DeclBase.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 69724a3d5eb..575b82d9afc 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -575,11 +575,13 @@ template <typename T>
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;
OpenPOWER on IntegriCloud