Bug 1915465 - libosmium-devel does not compile
Summary: libosmium-devel does not compile
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: All
OS: All
unspecified
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1914850
TreeView+ depends on / blocked
 
Reported: 2021-01-12 17:11 UTC by Thomas Sailer
Modified: 2021-01-29 10:35 UTC (History)
11 users (show)

Fixed In Version: gcc-11.0.0-0.14.fc34
Clone Of:
Environment:
Last Closed: 2021-01-29 10:35:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 98642 0 P1 ASSIGNED [10 Regression] wrong "use of deleted function" error 2021-01-29 09:52:29 UTC
Github osmcode libosmium issues 322 0 None closed Compilation error with g++11 2021-01-29 09:52:28 UTC

Description Thomas Sailer 2021-01-12 17:11:57 UTC
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:

Comment 1 Tom Hughes 2021-01-12 17:18:55 UTC
Unreleased compilers are not supported and even if they were this would be a matter for upstream.

Comment 2 Thomas Sailer 2021-01-12 17:20:01 UTC
That means osmium is not usable on Fedora

Comment 3 Tom Hughes 2021-01-12 17:22:14 UTC
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.

Comment 4 Tom Hughes 2021-01-12 17:37:44 UTC
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.

Comment 5 Tom Hughes 2021-01-12 19:29:25 UTC
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;
      |   ^~~~

Comment 6 Jakub Jelinek 2021-01-12 19:40:14 UTC
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.

Comment 7 Thomas Sailer 2021-01-12 19:47:37 UTC
Thanks Tom and Jakub.

My problem is that I need to use C++17 (or later) due to libpqxx...


Note You need to log in before you can comment on or make changes to this bug.