Bug 1915465
| Summary: | libosmium-devel does not compile | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Thomas Sailer <fedora> |
| Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | aoliva, dmalcolm, fweimer, jakub, jwakely, law, mpolacek, msebor, nickc, sipoyare, tom |
| Target Milestone: | --- | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | gcc-11.0.0-0.14.fc34 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-01-29 10:35:55 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1914850 | ||
Unreleased compilers are not supported and even if they were this would be a matter for upstream. That means osmium is not usable on Fedora Although an unreleased compiler is not really supported I will note that the compiler you reference is exactly the only which was used to build and test the new libosmium release a few days ago so it clearly does work when used properly. At a guess it's simply not valid to include that one header on it's own but that is something you would need to ask upstream about. I've opened an upstream ticket to see if Jochen thinks this is a genuine issue in libosmium or an issue in gcc that we should move to the gcc component here. I'm pretty sure this is a compiler bug. I can see no reason why instantiating a static object would need a move constructor for the base class of the object which appears to be what is going on here, and both gcc 10 and clang 11 are happy with it.
I've created a minimal reproducer:
class base {
public:
base(void) {};
base(base &&) = delete;
};
class foo : public base {
};
template<typename C>
inline C &bar(void)
{
static C c{};
return c;
}
const foo &baz(void)
{
return bar<const foo>();
}
which fails to compile with the same error:
bug.cpp: In instantiation of ‘C& bar() [with C = const foo]’:
bug.cpp:21:25: required from here
bug.cpp:15:12: error: use of deleted function ‘base::base(base&&)’
15 | static C c{};
| ^
bug.cpp:5:3: note: declared here
5 | base(base &&) = delete;
| ^~~~
Note, it is only rejected with -std=c++17 and above, with -std=c++14 it is still accepted, and it is rejected since https://gcc.gnu.org/r11-2704 aka https://gcc.gnu.org/PR93711 fix. I think we need a C++ language lawyer here. Thanks Tom and Jakub. My problem is that I need to use C++17 (or later) due to libpqxx... |
Description of problem: libosmium does not compile anymore with g++ 11 Version-Release number of selected component (if applicable): libosmium-devel-2.16.0-1.fc34.x86_64 gcc-c++-11.0.0-0.11.fc34.x86_64 How reproducible: always Steps to Reproduce: 1.cat > osm.cc < EOF #include <osmium/io/any_input.hpp> EOF 2.g++ -o osm.o -c osm.cc -Wall -O2 Actual results: In file included from /usr/include/osmium/memory/buffer.hpp:38, from /usr/include/osmium/builder/builder.hpp:36, from /usr/include/osmium/builder/osm_object_builder.hpp:36, from /usr/include/osmium/io/detail/o5m_input_format.hpp:36, from /usr/include/osmium/io/o5m_input.hpp:42, from /usr/include/osmium/io/any_input.hpp:48, from osm.cc:1: /usr/include/osmium/osm/entity.hpp: In instantiation of ‘TSubitem& osmium::detail::subitem_of_type(TIter, const TIter&) [with TSubitem = const osmium::TagList; TIter = osmium::memory::CollectionIterator<const osmium::memory::Item>]’: /usr/include/osmium/osm/object.hpp:333:83: required from here /usr/include/osmium/osm/entity.hpp:54:29: error: use of deleted function ‘osmium::memory::Collection<osmium::Tag, osmium::item_type::tag_list>::Collection(osmium::memory::Collection<osmium::Tag, osmium::item_type::tag_list>&&)’ 54 | static TSubitem subitem{}; | ^~~~~~~ In file included from /usr/include/osmium/osm/area.hpp:36, from /usr/include/osmium/builder/osm_object_builder.hpp:38, from /usr/include/osmium/io/detail/o5m_input_format.hpp:36, from /usr/include/osmium/io/o5m_input.hpp:42, from /usr/include/osmium/io/any_input.hpp:48, from osm.cc:1: /usr/include/osmium/memory/collection.hpp:117:15: note: ‘osmium::memory::Collection<osmium::Tag, osmium::item_type::tag_list>::Collection(osmium::memory::Collection<osmium::Tag, osmium::item_type::tag_list>&&)’ is implicitly deleted because the default definition would be ill-formed: 117 | class Collection : public Item { | ^~~~~~~~~~ /usr/include/osmium/memory/collection.hpp:117:15: error: use of deleted function ‘osmium::memory::Item::Item(osmium::memory::Item&&)’ In file included from /usr/include/osmium/memory/buffer.hpp:36, from /usr/include/osmium/builder/builder.hpp:36, from /usr/include/osmium/builder/osm_object_builder.hpp:36, from /usr/include/osmium/io/detail/o5m_input_format.hpp:36, from /usr/include/osmium/io/o5m_input.hpp:42, from /usr/include/osmium/io/any_input.hpp:48, from osm.cc:1: /usr/include/osmium/memory/item.hpp:146:13: note: declared here 146 | Item(Item&&) = delete; | ^~~~ In file included from /usr/include/osmium/memory/buffer.hpp:38, from /usr/include/osmium/builder/builder.hpp:36, from /usr/include/osmium/builder/osm_object_builder.hpp:36, from /usr/include/osmium/io/detail/o5m_input_format.hpp:36, from /usr/include/osmium/io/o5m_input.hpp:42, from /usr/include/osmium/io/any_input.hpp:48, from osm.cc:1: /usr/include/osmium/osm/entity.hpp: In instantiation of ‘TSubitem& osmium::detail::subitem_of_type(TIter, const TIter&) [with TSubitem = osmium::ChangesetDiscussion; TIter = osmium::memory::CollectionIterator<osmium::memory::Item>]’: /usr/include/osmium/osm/changeset.hpp:430:87: required from here /usr/include/osmium/osm/entity.hpp:54:29: error: use of deleted function ‘osmium::memory::Collection<osmium::ChangesetComment, osmium::item_type::changeset_discussion>::Collection(osmium::memory::Collection<osmium::ChangesetComment, osmium::item_type::changeset_discussion>&&)’ 54 | static TSubitem subitem{}; | ^~~~~~~ In file included from /usr/include/osmium/osm/area.hpp:36, from /usr/include/osmium/builder/osm_object_builder.hpp:38, from /usr/include/osmium/io/detail/o5m_input_format.hpp:36, from /usr/include/osmium/io/o5m_input.hpp:42, from /usr/include/osmium/io/any_input.hpp:48, from osm.cc:1: /usr/include/osmium/memory/collection.hpp:117:15: note: ‘osmium::memory::Collection<osmium::ChangesetComment, osmium::item_type::changeset_discussion>::Collection(osmium::memory::Collection<osmium::ChangesetComment, osmium::item_type::changeset_discussion>&&)’ is implicitly deleted because the default definition would be ill-formed: 117 | class Collection : public Item { | ^~~~~~~~~~ /usr/include/osmium/memory/collection.hpp:117:15: error: use of deleted function ‘osmium::memory::Item::Item(osmium::memory::Item&&)’ In file included from /usr/include/osmium/memory/buffer.hpp:36, from /usr/include/osmium/builder/builder.hpp:36, from /usr/include/osmium/builder/osm_object_builder.hpp:36, from /usr/include/osmium/io/detail/o5m_input_format.hpp:36, from /usr/include/osmium/io/o5m_input.hpp:42, from /usr/include/osmium/io/any_input.hpp:48, from osm.cc:1: /usr/include/osmium/memory/item.hpp:146:13: note: declared here 146 | Item(Item&&) = delete; | ^~~~ In file included from /usr/include/osmium/memory/buffer.hpp:38, from /usr/include/osmium/builder/builder.hpp:36, from /usr/include/osmium/builder/osm_object_builder.hpp:36, from /usr/include/osmium/io/detail/o5m_input_format.hpp:36, from /usr/include/osmium/io/o5m_input.hpp:42, from /usr/include/osmium/io/any_input.hpp:48, from osm.cc:1: /usr/include/osmium/osm/entity.hpp: In instantiation of ‘TSubitem& osmium::detail::subitem_of_type(TIter, const TIter&) [with TSubitem = const osmium::ChangesetDiscussion; TIter = osmium::memory::CollectionIterator<const osmium::memory::Item>]’: /usr/include/osmium/osm/changeset.hpp:434:95: required from here /usr/include/osmium/osm/entity.hpp:54:29: error: use of deleted function ‘osmium::memory::Collection<osmium::ChangesetComment, osmium::item_type::changeset_discussion>::Collection(osmium::memory::Collection<osmium::ChangesetComment, osmium::item_type::changeset_discussion>&&)’ 54 | static TSubitem subitem{}; | ^~~~~~~ /usr/include/osmium/osm/entity.hpp: In instantiation of ‘TSubitem& osmium::detail::subitem_of_type(TIter, const TIter&) [with TSubitem = osmium::RelationMemberList; TIter = osmium::memory::CollectionIterator<osmium::memory::Item>]’: /usr/include/osmium/osm/relation.hpp:188:86: required from here /usr/include/osmium/osm/entity.hpp:54:29: error: use of deleted function ‘osmium::memory::Collection<osmium::RelationMember, osmium::item_type::relation_member_list>::Collection(osmium::memory::Collection<osmium::RelationMember, osmium::item_type::relation_member_list>&&)’ In file included from /usr/include/osmium/osm/area.hpp:36, from /usr/include/osmium/builder/osm_object_builder.hpp:38, from /usr/include/osmium/io/detail/o5m_input_format.hpp:36, from /usr/include/osmium/io/o5m_input.hpp:42, from /usr/include/osmium/io/any_input.hpp:48, from osm.cc:1: /usr/include/osmium/memory/collection.hpp:117:15: note: ‘osmium::memory::Collection<osmium::RelationMember, osmium::item_type::relation_member_list>::Collection(osmium::memory::Collection<osmium::RelationMember, osmium::item_type::relation_member_list>&&)’ is implicitly deleted because the default definition would be ill-formed: 117 | class Collection : public Item { | ^~~~~~~~~~ /usr/include/osmium/memory/collection.hpp:117:15: error: use of deleted function ‘osmium::memory::Item::Item(osmium::memory::Item&&)’ In file included from /usr/include/osmium/memory/buffer.hpp:36, from /usr/include/osmium/builder/builder.hpp:36, from /usr/include/osmium/builder/osm_object_builder.hpp:36, from /usr/include/osmium/io/detail/o5m_input_format.hpp:36, from /usr/include/osmium/io/o5m_input.hpp:42, from /usr/include/osmium/io/any_input.hpp:48, from osm.cc:1: /usr/include/osmium/memory/item.hpp:146:13: note: declared here 146 | Item(Item&&) = delete; | ^~~~ In file included from /usr/include/osmium/memory/buffer.hpp:38, from /usr/include/osmium/builder/builder.hpp:36, from /usr/include/osmium/builder/osm_object_builder.hpp:36, from /usr/include/osmium/io/detail/o5m_input_format.hpp:36, from /usr/include/osmium/io/o5m_input.hpp:42, from /usr/include/osmium/io/any_input.hpp:48, from osm.cc:1: /usr/include/osmium/osm/entity.hpp: In instantiation of ‘TSubitem& osmium::detail::subitem_of_type(TIter, const TIter&) [with TSubitem = const osmium::RelationMemberList; TIter = osmium::memory::CollectionIterator<const osmium::memory::Item>]’: /usr/include/osmium/osm/relation.hpp:193:94: required from here /usr/include/osmium/osm/entity.hpp:54:29: error: use of deleted function ‘osmium::memory::Collection<osmium::RelationMember, osmium::item_type::relation_member_list>::Collection(osmium::memory::Collection<osmium::RelationMember, osmium::item_type::relation_member_list>&&)’ 54 | static TSubitem subitem{}; | ^~~~~~~ Expected results: no error Additional info: