Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-10220

Cling not compatible with libstdc++ 9.1 std::variant

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Medium
    • Resolution: Fixed
    • 6.16/00, 6.18/00
    • 6.24/00
    • Cling
    • None
    • Archlinux
      GCC 9.1.0
      ROOT 6.18

    Description

      Cling is incompatible with the std::variant implementation in libstdc++ 9.1.

      For instance, I have a class containing an std::variant<ROOT::RDF::RResultPtr<double>, double> and when generating the dictionary for this class I get the error

       
       
       
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/variant:159:16: error: cannot cast private base class 'std::__detail::__variant::_Move_ctor_base<false, ROOT::RDF::RResultPtr<double>, double>' to 'std::variant<ROOT::RDF::RResultPtr<double>, double>'
       return static_cast<variant<_Types...>&&>(__rhs);
       ^
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/variant:482:5: note: in instantiation of function template specialization 'std::__variant_cast<ROOT::RDF::RResultPtr<double>, double, std::__detail::__variant::_Move_ctor_base<false, ROOT::RDF::RResultPtr<double>, double> >'
       requested here
       }, __variant_cast<_Types...>(std::forward<_Up>(__rhs)));
       ^
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/variant:525:2: note: in instantiation of function template specialization 'std::__detail::__variant::__variant_construct<ROOT::RDF::RResultPtr<double>, double, std::__detail::__variant::_Move_ctor_base<false,
       ROOT::RDF::RResultPtr<double>, double> &, std::__detail::__variant::_Move_ctor_base<false, ROOT::RDF::RResultPtr<double>, double> >' requested here
       __variant_construct<_Types...>(*this, std::move(__rhs));
       ^
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/variant:620:7: note: in instantiation of member function 'std::__detail::__variant::_Move_ctor_base<false, ROOT::RDF::RResultPtr<double>, double>::_Move_ctor_base' requested here
       _Copy_assign_base(_Copy_assign_base&&) = default;
       ^
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/bits/alloc_traits.h:484:8: note: in instantiation of function template specialization '__gnu_cxx::new_allocator<std::variant<ROOT::RDF::RResultPtr<double>, double> >::construct<std::variant<ROOT::RDF::RResultPtr<double>, double>,
       std::variant<ROOT::RDF::RResultPtr<double>, double> >' requested here
       { __a.construct(__p, std::forward<_Args>(__args)...); }
       ^
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/bits/vector.tcc:115:21: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<std::variant<ROOT::RDF::RResultPtr<double>, double> > >::construct<std::variant<ROOT::RDF::RResultPtr<double>,
       double>, std::variant<ROOT::RDF::RResultPtr<double>, double> >' requested here
       _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
       ^
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/bits/stl_vector.h:1201:9: note: in instantiation of function template specialization 'std::vector<std::variant<ROOT::RDF::RResultPtr<double>, double>, std::allocator<std::variant<ROOT::RDF::RResultPtr<double>, double> >
       >::emplace_back<std::variant<ROOT::RDF::RResultPtr<double>, double> >' requested here
       { emplace_back(std::move(__x)); }
       ^
      /home/beojan/DPhil/hh4b/Resolved/recon/rdf-utils/Cutflow/CutflowWeighted.h:26:16: note: in instantiation of member function 'std::vector<std::variant<ROOT::RDF::RResultPtr<double>, double>, std::allocator<std::variant<ROOT::RDF::RResultPtr<double>, double> > >::push_back' requested here
       values.push_back(value);
       ^
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/variant:1220:7: note: constrained by private inheritance here
       : private __detail::__variant::_Variant_base<_Types...>,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/variant:156:13: error: cannot cast private base class 'std::__detail::__variant::_Variant_storage<false, ROOT::RDF::RResultPtr<double>, double>' to 'std::variant<ROOT::RDF::RResultPtr<double>, double>'
       return static_cast<variant<_Types...>&>(__rhs);
       ^
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/variant:392:7: note: in instantiation of function template specialization 'std::__variant_cast<ROOT::RDF::RResultPtr<double>, double, std::__detail::__variant::_Variant_storage<false, ROOT::RDF::RResultPtr<double>, double> &>'
       requested here
       }, __variant_cast<_Types...>(*this));
       ^
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/variant:397:2: note: in instantiation of member function 'std::__detail::__variant::_Variant_storage<false, ROOT::RDF::RResultPtr<double>, double>::_M_reset_impl' requested here
       _M_reset_impl();
       ^
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/variant:402:9: note: in instantiation of member function 'std::__detail::__variant::_Variant_storage<false, ROOT::RDF::RResultPtr<double>, double>::_M_reset' requested here
       { _M_reset(); }
       ^
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/variant:492:20: note: in instantiation of member function 'std::__detail::__variant::_Variant_storage<false, ROOT::RDF::RResultPtr<double>, double>::~_Variant_storage' requested here
       using _Base::_Base;
       ^
      /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/variant:1220:7: note: constrained by private inheritance here
       : private __detail::__variant::_Variant_base<_Types...>,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Error: /opt/root/bin/rootcling: compilation failure 
      

      Attachments

        Activity

          People

            axel Axel Naumann
            bstanisl Beojan Stanislaus
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: