public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "dangelog at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114764] noexcept on a friend complains about incomplete type Date: Sat, 20 Apr 2024 11:30:11 +0000 [thread overview] Message-ID: <bug-114764-4-eMmFv2kTxT@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-114764-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114764 --- Comment #7 from Giuseppe D'Angelo <dangelog at gmail dot com> --- I get it :) If you wanted an actual use-case (rather than a synthetic testcase), we stumbled upon this bug from implementing a friend operator==: ``` class S { bool comparesEqual(S, S) noexcept; // pass by value, object is small/trivially copyable friend inline bool operator==(S a, S b) noexcept(noexcept(comparesEqual(S, S))) { returns comparesEqual(a, b); } }; ``` which is the result of some macro expansions through which we support C++20's comparisons in C++17 in Qt. The problem is the pass by value -- changing it to pass by const-ref fixes it, but generates different linting about not passing a small TC object by value...
prev parent reply other threads:[~2024-04-20 11:30 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-04-18 9:21 [Bug c++/114764] New: " dangelog at gmail dot com 2024-04-18 17:14 ` [Bug c++/114764] " pinskia at gcc dot gnu.org 2024-04-18 18:09 ` mpolacek at gcc dot gnu.org 2024-04-18 18:24 ` dangelog at gmail dot com 2024-04-18 19:53 ` mpolacek at gcc dot gnu.org 2024-04-19 8:51 ` dangelog at gmail dot com 2024-04-19 15:49 ` mpolacek at gcc dot gnu.org 2024-04-20 11:30 ` dangelog at gmail dot com [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-114764-4-eMmFv2kTxT@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).