From 4d0397382c26ab3914654459223be8ca8f12f412 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 16 Feb 2015 19:38:52 +0000 Subject: [PATCH] MSVC no longer requires the explicit cast operation to obtain a function pointer from this capture-less lambda. NFC. llvm-svn: 229426 --- lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp index f79a243e7e6b..73748824d751 100644 --- a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp +++ b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp @@ -653,13 +653,8 @@ std::error_code FileCOFF::AtomizeDefinedSymbolsInSection( // Sort symbols by position. std::stable_sort( symbols.begin(), symbols.end(), - // For some reason MSVC fails to allow the lambda in this context with a - // "illegal use of local type in type instantiation". MSVC is clearly - // wrong here. Force a conversion to function pointer to work around. - static_cast( - [](llvm::object::COFFSymbolRef a, llvm::object::COFFSymbolRef b) - -> bool { return a.getValue() < b.getValue(); })); + [](llvm::object::COFFSymbolRef a, llvm::object::COFFSymbolRef b) + -> bool { return a.getValue() < b.getValue(); }); StringRef sectionName; if (std::error_code ec = _obj->getSectionName(section, sectionName))