diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-10-26 02:31:56 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-10-26 02:31:56 +0000 |
commit | 842e46e606b13e29b4136a455ad5d77249a7f9f4 (patch) | |
tree | 16f43c1d3d1a745f60e4648cf5bc78706aa4015b /clang/lib/Serialization/ASTReaderDecl.cpp | |
parent | 28a1b8c8bb01408fea27700a65d212eb0137a6f0 (diff) | |
download | bcm5719-llvm-842e46e606b13e29b4136a455ad5d77249a7f9f4.tar.gz bcm5719-llvm-842e46e606b13e29b4136a455ad5d77249a7f9f4.zip |
[modules] Fix assert if multiple update records provide a definition for a
class template specialization and that specialization has attributes.
llvm-svn: 285160
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReaderDecl.cpp | 5 |
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; } |