public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "m.cencora at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103563] ostream operator<< resolved to variant containing type resulting in stack overflow Date: Mon, 06 Dec 2021 16:09:20 +0000 [thread overview] Message-ID: <bug-103563-4-yqCJ8jGZPg@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103563-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103563 m.cencora at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.cencora at gmail dot com --- Comment #3 from m.cencora at gmail dot com --- This is a known issue with operators in C++ in general. That's why coding guidelines suggest that operators should be declared as hidden friends (to prevent unexpected implicit conversions). In your scenario you cannot make it a hidden friend, so constraint it with a concept or SFINAE: https://godbolt.org/z/de869vW6h
next prev parent reply other threads:[~2021-12-06 16:09 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-12-05 10:41 [Bug c++/103563] New: " samuel.hangouet at gmail dot com 2021-12-05 11:07 ` [Bug c++/103563] " pinskia at gcc dot gnu.org 2021-12-05 11:17 ` pinskia at gcc dot gnu.org 2021-12-06 16:09 ` m.cencora at gmail dot com [this message] 2021-12-15 10:10 ` samuel.hangouet at gmail dot com
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-103563-4-yqCJ8jGZPg@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).