public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107755] [10/11/12/13 Regression] ICE: in fold_convert_loc, at fold-const.c:2435, with -Wlogical-op, implicit user-defined conversion operator, template function, logical operator, and conditional operator Date: Wed, 01 Feb 2023 13:31:17 +0000 [thread overview] Message-ID: <bug-107755-4-wMBI3fMvtb@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-107755-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107755 --- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>: https://gcc.gnu.org/g:5ce8961b46f050a96e8c542b34b1cf024ba95f1b commit r13-5627-g5ce8961b46f050a96e8c542b34b1cf024ba95f1b Author: Marek Polacek <polacek@redhat.com> Date: Tue Jan 31 14:36:30 2023 -0500 c++: ICE with -Wlogical-op [PR107755] Here we crash in the middle end because warn_logical_operator calls build_range_check which calls various fold_* functions and those don't work too well when we're still processing template trees. For instance here we crash because we're converting a RECORD_TYPE to bool. At this point VIEW_CONVERT_EXPR<struct Foo>(b) hasn't yet been converted to Foo::operator bool (&b). I was excited to fix this with instantiation_dependent_expression_p which can now be called from c-family/ as well, but the problem isn't that the expression is dependent. So, p_t_d it is. PR c++/107755 gcc/cp/ChangeLog: * call.cc (build_new_op): Don't call warn_logical_operator when processing a template. gcc/testsuite/ChangeLog: * g++.dg/warn/Wlogical-op-4.C: New test.
next prev parent reply other threads:[~2023-02-01 13:31 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-19 1:27 [Bug c++/107755] New: " pokechu022+gccbugzilla at gmail dot com 2022-11-19 1:37 ` [Bug c++/107755] " pokechu022+gccbugzilla at gmail dot com 2022-11-21 8:53 ` marxin at gcc dot gnu.org 2022-11-21 19:48 ` mpolacek at gcc dot gnu.org 2022-11-21 19:49 ` [Bug c++/107755] [10/11/12/13 Regression] " mpolacek at gcc dot gnu.org 2022-11-24 17:43 ` jakub at gcc dot gnu.org 2023-01-31 19:29 ` mpolacek at gcc dot gnu.org 2023-02-01 13:31 ` cvs-commit at gcc dot gnu.org [this message] 2023-02-01 13:43 ` cvs-commit at gcc dot gnu.org 2023-02-01 13:44 ` [Bug c++/107755] [10/11 " mpolacek at gcc dot gnu.org
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-107755-4-wMBI3fMvtb@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).