From: Reid Kleckner Date: Thu, 21 May 2015 00:12:53 +0000 (+0000) Subject: Work around overloading bug in MSVC 2015 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ac6be55428552b69ed91c4c5c49507bb10bf6cc;p=clang Work around overloading bug in MSVC 2015 MSVC 2015 appears to be unable to find the correct operator== here. I haven't yet filed a bug with Microsoft as I've been unable to create a reduced test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237862 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp index 8c9f57deb2..2101a5534a 100644 --- a/lib/AST/RecordLayoutBuilder.cpp +++ b/lib/AST/RecordLayoutBuilder.cpp @@ -2976,11 +2976,11 @@ void ASTContext::setNonKeyFunction(const CXXMethodDecl *Method) { // Look up the cache entry. Since we're working with the first // declaration, its parent must be the class definition, which is // the correct key for the KeyFunctions hash. - llvm::DenseMap::iterator - I = KeyFunctions.find(Method->getParent()); + const auto &Map = KeyFunctions; + auto I = Map.find(Method->getParent()); // If it's not cached, there's nothing to do. - if (I == KeyFunctions.end()) return; + if (I == Map.end()) return; // If it is cached, check whether it's the target method, and if so, // remove it from the cache. Note, the call to 'get' might invalidate