summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index eb0abafcaaa..230ea3cb9da 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -276,7 +276,6 @@ static bool DeclHasAttr(const Decl *decl, const Attr *target) {
static void MergeAttributes(Decl *New, Decl *Old) {
Attr *attr = const_cast<Attr*>(Old->getAttrs()), *tmp;
-// FIXME: fix this code to cleanup the Old attrs correctly
while (attr) {
tmp = attr;
attr = attr->getNext();
@@ -288,6 +287,8 @@ static void MergeAttributes(Decl *New, Decl *Old) {
delete(tmp);
}
}
+
+ Old->invalidateAttrs();
}
/// MergeFunctionDecl - We just parsed a function 'New' from
OpenPOWER on IntegriCloud