From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D3F33385842F; Fri, 9 Feb 2024 21:38:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D3F33385842F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707514686; bh=2rERV7Iubp6hvq3dwRvvdaiLSjrT6uRtlJz3VE++Q6w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=a9Fv6eYTgZVIC/BdycbfgutCasrwE8+FEmGHgPs1+1xFtz7+uWbKVjlwF89tdHtBW Nqqu0PZUjkGbKn44ZxbRLMJTZ8ycsyxSYs2F74/3FhsdwYjkG53SuZW5D4LZsycVhV FWRXIw9DWl0y8ewieAQAU+/qaPJId8Bd+qnrtBdo= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98388] Throwing move-only parameter results in hard error in SFINAE context Date: Fri, 09 Feb 2024 21:38:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98388 --- Comment #1 from GCC Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:3a3e0f1b46a3ad71ebeedc419393e3a36f1ce6db commit r14-8903-g3a3e0f1b46a3ad71ebeedc419393e3a36f1ce6db Author: Marek Polacek Date: Tue Feb 6 15:35:16 2024 -0500 c++: make build_throw SFINAE-friendly [PR98388] Here the problem is that we give hard errors while substituting template parameters during overload resolution of is_throwable which has an invalid throw in decltype. The backtrace shows that fn_type_unification -> instantiate_template -> tsubst* passes complain=3D0 as expected, but build_throw doesn't have a complain parameter. So let's add one. Also remove a redundant local variable which I should have removed in my P2266 patch. There's still one problem for which I opened . We need to patch up treat_lvalue_as_rvalue_p and remove the dg-bogus. Thanks to Patrick for notifying me of this PR. This doesn't fully fix 113789; there I think I'll have to figure our why a candidate wasn't discarded from the overload set. PR c++/98388 gcc/cp/ChangeLog: * coroutines.cc (coro_rewrite_function_body): Pass tf_warning_or_error to build_throw. (morph_fn_to_coro): Likewise. * cp-tree.h (build_throw): Adjust. * except.cc (expand_end_catch_block): Pass tf_warning_or_error = to build_throw. (build_throw): Add a tsubst_flags_t parameter. Use it. Remove redundant variable. Guard an inform call. * parser.cc (cp_parser_throw_expression): Pass tf_warning_or_er= ror to build_throw. * pt.cc (tsubst_expr) : Pass complain to build_throw. libcc1/ChangeLog: * libcp1plugin.cc (plugin_build_unary_expr): Pass tf_error to build_throw. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/sfinae69.C: New test.=