r235264 - Try to work around failure to convert this lambda to a function pointer in some versions of GCC.

Richard Smith richard-llvm at metafoo.co.uk
Sat Apr 18 18:47:53 PDT 2015


Author: rsmith
Date: Sat Apr 18 20:47:53 2015
New Revision: 235264

URL: http://llvm.org/viewvc/llvm-project?rev=235264&view=rev
Log:
Try to work around failure to convert this lambda to a function pointer in some versions of GCC.

Modified:
    cfe/trunk/lib/Serialization/ASTWriter.cpp

Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=235264&r1=235263&r2=235264&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp Sat Apr 18 20:47:53 2015
@@ -2073,10 +2073,11 @@ void ASTWriter::WritePreprocessor(const
 
   // 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.





More information about the cfe-commits mailing list