public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/103891] New: clang-13 fails to compile libstdc++'s std::variant<std::vector<int>>: error: attempt to use a deleted function
@ 2022-01-02 21:40 slyfox at gcc dot gnu.org
  2022-01-02 21:59 ` [Bug libstdc++/103891] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: slyfox at gcc dot gnu.org @ 2022-01-02 21:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103891

            Bug ID: 103891
           Summary: clang-13 fails to compile libstdc++'s
                    std::variant<std::vector<int>>: error: attempt to use
                    a deleted function
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Initially I observed the error as a mold-1.0.0 build failure on clang-13 which
uses gcc-12's libstdc++. Here is a one line reproducer:

    #include <variant>
    #include <vector>

    std::variant<std::vector<long> > v;

$ /tmp/gcc-12/bin/c++ -std=c++20 -c tapi.cc
$ /tmp/clang-13/bin/c++ -std=c++20 -c tapi.cc
/<<NIX>>/gcc-12.0.0/include/c++/12.0.0/variant:460:2: error: attempt to use a
deleted function
        _Variant_storage(in_place_index_t<_Np>, _Args&&... __args)
        ^
/<<NIX>>/gcc-12.0.0/include/c++/12.0.0/variant:747:4: note: in instantiation of
function template specialization
'std::__detail::__variant::_Variant_storage<false,
std::vector<long>>::_Variant_storage<0UL>' requested here
        : _Base(__i, std::forward<_Args>(__args)...)
          ^
/<<NIX>>/gcc-12.0.0/include/c++/12.0.0/variant:742:9: note: in instantiation of
function template specialization
'std::__detail::__variant::_Variant_base<std::vector<long>>::_Variant_base<0UL>'
requested here
      : _Variant_base(in_place_index<0>) { }
        ^
/<<NIX>>/gcc-12.0.0/include/c++/12.0.0/variant:1403:7: note: in instantiation
of member function
'std::__detail::__variant::_Variant_base<std::vector<long>>::_Variant_base'
requested here
      variant() = default;
      ^
...


I attempted to reduce it down to something manageable but ended up with
something else: https://github.com/llvm/llvm-project/issues/52956

I don't really understand how requires() works.

Should libstdc++ work as is against clang++? Does it perhaps need a small
tweak?

Thank you!

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-02-14 13:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-02 21:40 [Bug libstdc++/103891] New: clang-13 fails to compile libstdc++'s std::variant<std::vector<int>>: error: attempt to use a deleted function slyfox at gcc dot gnu.org
2022-01-02 21:59 ` [Bug libstdc++/103891] " pinskia at gcc dot gnu.org
2022-01-03 15:55 ` ppalka at gcc dot gnu.org
2022-01-04 10:07 ` redi at gcc dot gnu.org
2022-01-04 10:17 ` redi at gcc dot gnu.org
2022-01-09  9:10 ` slyfox at gcc dot gnu.org
2022-01-11 13:24 ` cvs-commit at gcc dot gnu.org
2022-01-11 13:32 ` redi at gcc dot gnu.org
2022-01-11 16:27 ` slyfox at gcc dot gnu.org
2022-02-14 13:06 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).