summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index 94097cd2e1b..07df7548e5f 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -3930,7 +3930,10 @@ void ASTDeclReader::UpdateDecl(Decl *D, ModuleFile &ModuleFile,
if (Record[Idx++]) {
AttrVec Attrs;
Reader.ReadAttributes(F, Attrs, Record, Idx);
- D->setAttrsImpl(Attrs, Reader.getContext());
+ // If the declaration already has attributes, we assume that some other
+ // AST file already loaded them.
+ if (!D->hasAttrs())
+ D->setAttrsImpl(Attrs, Reader.getContext());
}
break;
}
OpenPOWER on IntegriCloud