From 0c8c57ca43cda0ab332bb1a9e39ee4aa0cc31b28 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sun, 19 Apr 2015 01:47:53 +0000 Subject: [PATCH] Try to work around failure to convert this lambda to a function pointer in some versions of GCC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235264 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Serialization/ASTWriter.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 217203192c..b522dadb9d 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -2073,10 +2073,11 @@ void ASTWriter::WritePreprocessor(const Preprocessor &PP, bool IsModule) { // Sort the set of macro definitions that need to be serialized by the // name of the macro, to provide a stable ordering. - llvm::array_pod_sort(MacroDirectives.begin(), MacroDirectives.end(), - [](const MacroChain *A, const MacroChain *B) -> int { - return A->first->getName().compare(B->first->getName()); - }); + int (*Cmp)(const MacroChain*, const MacroChain*) = + [](const MacroChain *A, const MacroChain *B) -> int { + return A->first->getName().compare(B->first->getName()); + }; + llvm::array_pod_sort(MacroDirectives.begin(), MacroDirectives.end(), Cmp); // Emit the macro directives as a list and associate the offset with the // identifier they belong to. -- 2.40.0