public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96533] New: ICE with -Wunused-parameter when using three-way comparison
@ 2020-08-08  2:29 natattak at gmail dot com
  2020-08-09 15:16 ` [Bug c++/96533] " natattak at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: natattak at gmail dot com @ 2020-08-08  2:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96533
           Summary: ICE with -Wunused-parameter when using three-way
                    comparison
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: natattak at gmail dot com
  Target Milestone: ---

Minimal example:

  #include <compare>
  #include <functional>

  struct S {
    // making it a member fixes the issue
    friend auto operator<=>(S, S) = default;
  };

  // removing 'rhs' fixes the issue
  template <typename Lhs, typename Rhs>
  auto operator<(Lhs&&, Rhs&& rhs) {
    return true;
  }

  int main() {
    // using operator< directly fixes the issue
    //return S{} < S{};
    return std::less{}(S{}, S{});
  }

Compiled with `g++ -std=c++20 -Wunused-parameter`. Output:

  '
  Internal compiler error: Error reporting routines re-entered.
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <https://gcc.gnu.org/bugs/> for instructions.

First noticed on g++ 10.1, tested on compiler explorer with current trunk:
https://godbolt.org/z/85j8TW

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

end of thread, other threads:[~2023-07-13 20:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-08  2:29 [Bug c++/96533] New: ICE with -Wunused-parameter when using three-way comparison natattak at gmail dot com
2020-08-09 15:16 ` [Bug c++/96533] " natattak at gmail dot com
2020-08-09 15:19 ` [Bug c++/96533] ICE with three-way comparison when error occurs in templated operator< overload natattak at gmail dot com
2021-12-16 12:39 ` [Bug c++/96533] ICE with three-way comparison when error occurs in templated operator< overload and -Wunused-parameter pinskia at gcc dot gnu.org
2021-12-16 14:25 ` pinskia at gcc dot gnu.org
2021-12-16 14:28 ` pinskia at gcc dot gnu.org
2021-12-16 14:44 ` pinskia at gcc dot gnu.org
2021-12-16 14:53 ` pinskia at gcc dot gnu.org
2021-12-16 14:54 ` pinskia at gcc dot gnu.org
2021-12-16 15:10 ` mpolacek at gcc dot gnu.org
2023-07-13 19:06 ` ppalka at gcc dot gnu.org
2023-07-13 20:09 ` ppalka 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).