summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-08-25 02:10:01 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-08-25 02:10:01 +0000
commit88126a25ebae096fa45b83b2998657c0c9030449 (patch)
tree2dd494a04781ffdf4b3898ce56bdd669837b33f3 /clang/lib/Serialization/ASTReaderDecl.cpp
parent6e69927d03eddf49f83c03a0eea1a93be085d52b (diff)
downloadbcm5719-llvm-88126a25ebae096fa45b83b2998657c0c9030449.tar.gz
bcm5719-llvm-88126a25ebae096fa45b83b2998657c0c9030449.zip
[modules] Fix false report of an ODR violation when merging friend
declarations. We can't expect to find them in the canonical definition of the class, because that's not where they live. This means we no longer reject real ODR violations with friend declarations, but we weren't consistently doing so anyway. llvm-svn: 216369
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index 3ac67071f0d..4f1c4ec6915 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -2548,7 +2548,9 @@ ASTDeclReader::FindExistingResult ASTDeclReader::findExisting(NamedDecl *D) {
//
// FIXME: We should do something similar if we merge two definitions of the
// same template specialization into the same CXXRecordDecl.
- if (Reader.MergedDeclContexts.count(D->getLexicalDeclContext()))
+ auto MergedDCIt = Reader.MergedDeclContexts.find(D->getLexicalDeclContext());
+ if (MergedDCIt != Reader.MergedDeclContexts.end() &&
+ MergedDCIt->second == D->getDeclContext())
Reader.PendingOdrMergeChecks.push_back(D);
return FindExistingResult(Reader, D, /*Existing=*/nullptr);
OpenPOWER on IntegriCloud