public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96499] New: Compare std::variant with int using C++20 <=> occurs internal compiler error
@ 2020-08-06 13:54 hewillk at gmail dot com
  2020-10-22 15:48 ` [Bug c++/96499] Pass ill-formed visitor with different return type of result type of 3-way comparison into std::visit " hewillk at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: hewillk at gmail dot com @ 2020-08-06 13:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96499
           Summary: Compare std::variant with int using C++20 <=> occurs
                    internal compiler error
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

#include <variant>

constexpr auto operator<=>(const auto& v, const auto& u) {
  return std::visit([&u](const auto& t) { return t <=> u; }, v);
}

constexpr std::variant<double, int> v{1};
static_assert(v < 2);

This will occurs internal compiler error for gcc-trunk.

godbolt link:
https://godbolt.org/z/EcGKc3

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

* [Bug c++/96499] Pass ill-formed visitor with different return type of result type of 3-way comparison into std::visit occurs internal compiler error
  2020-08-06 13:54 [Bug c++/96499] New: Compare std::variant with int using C++20 <=> occurs internal compiler error hewillk at gmail dot com
@ 2020-10-22 15:48 ` hewillk at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: hewillk at gmail dot com @ 2020-10-22 15:48 UTC (permalink / raw)
  To: gcc-bugs

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

康桓瑋 <hewillk at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from 康桓瑋 <hewillk at gmail dot com> ---
Fixed.

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

end of thread, other threads:[~2020-10-22 15:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 13:54 [Bug c++/96499] New: Compare std::variant with int using C++20 <=> occurs internal compiler error hewillk at gmail dot com
2020-10-22 15:48 ` [Bug c++/96499] Pass ill-formed visitor with different return type of result type of 3-way comparison into std::visit " hewillk at gmail dot com

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).