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++/104620] FAIL: g++.dg/cpp23/consteval-if2.C -std=gnu++20 (test for errors) Date: Thu, 24 Mar 2022 15:42:44 +0000 [thread overview] Message-ID: <bug-104620-4-yiWEbh94XZ@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-104620-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104620 --- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>: https://gcc.gnu.org/g:647537adefb34041cc2d44585252fd765cc0daae commit r12-7802-g647537adefb34041cc2d44585252fd765cc0daae Author: Patrick Palka <ppalka@redhat.com> Date: Thu Mar 24 11:42:31 2022 -0400 c++: missing SFINAE for non-constant consteval calls [PR104620] Here we weren't respecting SFINAE when evaluating a call to a consteval function, which caused us to reject the new testcase below. This patch fixes this by making build_over_call use the SFINAE-friendly version of cxx_constant_value. This change causes us to no longer diagnose ahead of time a couple of non-constant non-dependent consteval calls in consteval-if2.C with -fchecking=2. These errors were apparently coming from the call to fold_non_dependent_expr in build_non_dependent_expr (for the RHS of the +=) despite complain=tf_none being passed. Now that build_over_call respects the value of complain during constant evaluation of a consteval call, the errors are gone. That the errors are also gone without -fchecking=2 is a regression caused by r12-7264-gc19f317a78c0e4 and is the subject of PR104620. As described in comment #5, I think it's basically an accident that we were diagnosing these two calls correctly before r12-7264, so perhaps we can live without these errors for GCC 12. Thus this patch just XFAILs the two tests. PR c++/104620 gcc/cp/ChangeLog: * call.cc (build_over_call): Use cxx_constant_value_sfinae instead of cxx_constant_value to evaluate a consteval call. * constexpr.cc (cxx_constant_value_sfinae): Add decl parameter and pass it to cxx_eval_outermost_constant_expr. * cp-tree.h (cxx_constant_value_sfinae): Add decl parameter. * pt.cc (fold_targs_r): Pass NULL_TREE as decl parameter to cxx_constant_value_sfinae. gcc/testsuite/ChangeLog: * g++.dg/cpp23/consteval-if2.C: XFAIL two dg-error tests where the argument to the non-constant non-dependent consteval call is wrapped by NON_DEPENDENT_EXPR. * g++.dg/cpp2a/consteval30.C: New test.
next prev parent reply other threads:[~2022-03-24 15:42 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-02-21 19:38 [Bug c++/104620] New: " danglin at gcc dot gnu.org 2022-03-23 18:04 ` [Bug c++/104620] " mpolacek at gcc dot gnu.org 2022-03-23 18:42 ` mpolacek at gcc dot gnu.org 2022-03-23 20:35 ` ppalka at gcc dot gnu.org 2022-03-24 12:21 ` jakub at gcc dot gnu.org 2022-03-24 13:29 ` jakub at gcc dot gnu.org 2022-03-24 13:31 ` ppalka at gcc dot gnu.org 2022-03-24 13:37 ` ppalka at gcc dot gnu.org 2022-03-24 14:29 ` ppalka at gcc dot gnu.org 2022-03-24 15:21 ` jason at gcc dot gnu.org 2022-03-24 15:42 ` cvs-commit at gcc dot gnu.org [this message] 2022-03-24 17:19 ` ppalka at gcc dot gnu.org 2022-03-26 23:01 ` jason at gcc dot gnu.org 2022-05-06 8:32 ` jakub at gcc dot gnu.org 2023-05-08 12:23 ` rguenth 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-104620-4-yiWEbh94XZ@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).