]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix bootstrap failure (with g++ 4.8.5) in tree-if-conv.cc.
authorRoger Sayle <roger@nextmovesoftware.com>
Mon, 17 Jul 2023 06:35:08 +0000 (07:35 +0100)
committerRoger Sayle <roger@nextmovesoftware.com>
Mon, 17 Jul 2023 06:35:08 +0000 (07:35 +0100)
This patch fixes the bootstrap failure I'm seeing using gcc 4.8.5 as
the host compiler.

2023-07-17  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
* tree-if-conv.cc (predicate_scalar_phi): Make the arguments
to the std::sort comparison lambda function const.

gcc/tree-if-conv.cc

index 91e2eff5d5c0ad3f5fd4656b24c37fd43dc3e94b..799f071965e5c41eb352b5530cf1d9c7ecf7bf25 100644 (file)
@@ -2204,7 +2204,8 @@ predicate_scalar_phi (gphi *phi, gimple_stmt_iterator *gsi)
     }
 
   /* Sort elements based on rankings ARGS.  */
-  std::sort(argsKV.begin(), argsKV.end(), [](ArgEntry &left, ArgEntry &right) {
+  std::sort(argsKV.begin(), argsKV.end(), [](const ArgEntry &left,
+                                            const ArgEntry &right) {
     return left.second < right.second;
   });