Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 732818 - dev-util/codeblocks-20.03-r1: fails to build with gcc-11
Summary: dev-util/codeblocks-20.03-r1: fails to build with gcc-11
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Sergey Torokhov
URL: https://sourceforge.net/p/codeblocks/...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: gcc-11
  Show dependency tree
 
Reported: 2020-07-16 04:15 UTC by lekto
Modified: 2020-10-14 18:35 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,807.22 KB, text/x-log)
2020-07-16 04:15 UTC, lekto
Details
emerge --info (emerge.info,5.69 KB, application/x-info)
2020-07-16 04:15 UTC, lekto
Details
codeblocks-9999.patch (codeblocks-9999.patch,668 bytes, patch)
2020-10-11 19:54 UTC, Sergei Trofimovich (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description lekto 2020-07-16 04:15:20 UTC
Created attachment 649394 [details]
build.log

In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/11.0.0/include/g++-v11/map:60,
                 from ../../../src/include/manager.h:9,
                 from openfileslistplugin.cpp:13:
/usr/lib/gcc/x86_64-pc-linux-gnu/11.0.0/include/g++-v11/bits/stl_tree.h: In instantiation of ‘static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_S_key(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type) [with _Key = ProjectFile*; _Val = ProjectFile*; _KeyOfValue = std::_Identity<ProjectFile*>; _Compare = TargetFilesData::compareLess; _Alloc = std::allocator<ProjectFile*>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type = const std::_Rb_tree_node<ProjectFile*>*]’:
/usr/lib/gcc/x86_64-pc-linux-gnu/11.0.0/include/g++-v11/bits/stl_tree.h:2103:47:   required from ‘std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_unique_pos(const key_type&) [with _Key = ProjectFile*; _Val = ProjectFile*; _KeyOfValue = std::_Identity<ProjectFile*>; _Compare = TargetFilesData::compareLess; _Alloc = std::allocator<ProjectFile*>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::key_type = ProjectFile*]’
/usr/lib/gcc/x86_64-pc-linux-gnu/11.0.0/include/g++-v11/bits/stl_tree.h:2156:4:   required from ‘std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = ProjectFile* const&; _Key = ProjectFile*; _Val = ProjectFile*; _KeyOfValue = std::_Identity<ProjectFile*>; _Compare = TargetFilesData::compareLess; _Alloc = std::allocator<ProjectFile*>]’
/usr/lib/gcc/x86_64-pc-linux-gnu/11.0.0/include/g++-v11/bits/stl_set.h:512:25:   required from ‘std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = ProjectFile*; _Compare = TargetFilesData::compareLess; _Alloc = std::allocator<ProjectFile*>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<ProjectFile*, ProjectFile*, std::_Identity<ProjectFile*>, TargetFilesData::compareLess, std::allocator<ProjectFile*> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other = std::allocator<ProjectFile*>; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<ProjectFile*>, ProjectFile*>::rebind<ProjectFile*>; typename _Allocator::value_type = ProjectFile*; std::set<_Key, _Compare, _Alloc>::value_type = ProjectFile*]’
openfileslistplugin.cpp:440:60:   required from here
/usr/lib/gcc/x86_64-pc-linux-gnu/11.0.0/include/g++-v11/bits/stl_tree.h:782:15: error: static assertion failed: comparison object must be invocable as const
  782 |               is_invocable_v<const _Compare&, const _Key&, const _Key&>,
      |
Comment 1 lekto 2020-07-16 04:15:43 UTC
Created attachment 649396 [details]
emerge --info
Comment 2 Jonas Stein gentoo-dev 2020-07-19 13:58:18 UTC
also failed with gcc-10 in #733122. Please double check, if it is gcc-11 related here.
Comment 3 Sergey Torokhov 2020-09-02 22:55:12 UTC
Sorry, the build time of GCC is too long on my current PC so I can't currently test build against live/git packages like sys-devel/gcc-11.0.0_pre9999. Waiting for unmasking of gcc-11.
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2020-10-11 19:54:09 UTC
Created attachment 664792 [details, diff]
codeblocks-9999.patch

I tried -9999 today and it looks like one liner (attached as codeblocks-9999.patch) is enough:

--- a/src/plugins/openfileslist/openfileslistplugin.h
+++ b/src/plugins/openfileslist/openfileslistplugin.h
@@ -23,7 +23,7 @@ struct TargetFilesData
     // Functor for the std::set predicate to sort the opened editor files according to their tab order
     struct compareLess
     {
-        bool operator()(const ProjectFile* lhs, const ProjectFile* rhs) { return lhs->editorTabPos < rhs->editorTabPos; }
+        bool operator()(const ProjectFile* lhs, const ProjectFile* rhs) const { return lhs->editorTabPos < rhs->editorTabPos; }
     };
     typedef std::set<ProjectFile*, compareLess> OpenFilesSet;
     ProjectFile* activeFile;
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2020-10-11 19:58:19 UTC
Filed upstream as https://sourceforge.net/p/codeblocks/tickets/1022/
Comment 6 Larry the Git Cow gentoo-dev 2020-10-14 18:35:14 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56d8bafba4d7c3431ebcbd05492f0b16b5ce8001

commit 56d8bafba4d7c3431ebcbd05492f0b16b5ce8001
Author:     band-a-prend <torokhov-s-a@yandex.ru>
AuthorDate: 2020-10-14 15:29:49 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-10-14 18:35:08 +0000

    dev-util/codeblocks: fix gcc-11 compatibility
    
    The GCC 11 now enforces that comparison objects be invocable as const.
    
    Current patch to fix gcc-11 compatibility is proposed by
    Sergei Trofimovich <slyfox@gentoo.org>
    and fix codeblocks "openfileslist" pligin compilation error.
    
    Patch was sent to upstream :
    https://sourceforge.net/p/codeblocks/tickets/1022/
    so live-ebuild currently doesn't apply it.
    
    Closes: https://bugs.gentoo.org/732818
    
    Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru>
    Closes: https://github.com/gentoo/gentoo/pull/17928
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 dev-util/codeblocks/codeblocks-17.12-r304.ebuild   | 83 ++++++++++++++++++++++
 dev-util/codeblocks/codeblocks-20.03-r2.ebuild     | 77 ++++++++++++++++++++
 .../codeblocks-20.03_gcc11_compatibility.patch     | 12 ++++
 3 files changed, 172 insertions(+)