]> granicus.if.org Git - clang/commitdiff
Work around overloading bug in MSVC 2015
authorReid Kleckner <reid@kleckner.net>
Thu, 21 May 2015 00:12:53 +0000 (00:12 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 21 May 2015 00:12:53 +0000 (00:12 +0000)
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

lib/AST/RecordLayoutBuilder.cpp

index 8c9f57deb2362dc479667d645815fb6a92d52401..2101a5534a6bef977b2b8f5a02e586f7a608ab93 100644 (file)
@@ -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<const CXXRecordDecl*, LazyDeclPtr>::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