{"id":2228297,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2228297/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/tencent_19FEFC275354E2548FA1A484B58368F6800A@qq.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/1.1/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<tencent_19FEFC275354E2548FA1A484B58368F6800A@qq.com>","date":"2026-04-25T20:36:10","name":"[v3] c++, contracts: fix testsuite basic.contract.eval.p8 failed","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"9f56bf1789edccdd0cafe84fa4a3499b4a3d757c","submitter":{"id":89506,"url":"http://patchwork.ozlabs.org/api/1.1/people/89506/?format=json","name":"yxj-github-437","email":"2457369732@qq.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/tencent_19FEFC275354E2548FA1A484B58368F6800A@qq.com/mbox/","series":[{"id":501486,"url":"http://patchwork.ozlabs.org/api/1.1/series/501486/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=501486","date":"2026-04-25T20:36:10","name":"[v3] c++, contracts: fix testsuite basic.contract.eval.p8 failed","version":3,"mbox":"http://patchwork.ozlabs.org/series/501486/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2228297/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2228297/checks/","tags":{},"headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=qq.com header.i=@qq.com header.a=rsa-sha256\n header.s=s201512 header.b=bMJhlLCb;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=qq.com header.i=@qq.com header.a=rsa-sha256\n header.s=s201512 header.b=bMJhlLCb","sourceware.org;\n dmarc=pass (p=quarantine dis=none) header.from=qq.com","sourceware.org; spf=pass smtp.mailfrom=qq.com","server2.sourceware.org;\n arc=none smtp.remote-ip=203.205.221.221"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g31sm1ZY1z1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 26 Apr 2026 06:39:54 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id E45604BB58F7\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2026 20:39:51 +0000 (GMT)","from out203-205-221-221.mail.qq.com (out203-205-221-221.mail.qq.com\n [203.205.221.221])\n by sourceware.org (Postfix) with UTF8SMTPS id 32F8B4BB5887;\n Sat, 25 Apr 2026 20:39:12 +0000 (GMT)","from localhost.localdomain ([123.139.9.43])\n by newxmesmtplogicsvrszc56-0.qq.com (NewEsmtp) with SMTP\n id 9C7140FC; Sun, 26 Apr 2026 04:39:07 +0800"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org E45604BB58F7","OpenDKIM Filter v2.11.0 sourceware.org 32F8B4BB5887"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 32F8B4BB5887","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 32F8B4BB5887","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777149554; cv=none;\n b=Ng0u8DjG5zxLBLOCC45rW/7FIgS0w/9isUCreNnHKSnkm2/iUcIkMoMpJocuA+56T5QUiWWO6HoYVJbLtUZRtRAN6egjl/A8wv6O8XpD5INmAAKp1PuPjPINOylas8qQOn1qqwRu8ouelWO1cMJoYq7MXyDzSgRFIHfsoi3p7rI=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777149554; c=relaxed/simple;\n bh=Fo43qOxBNLSbhSU0z5tA6C1JzUVqF5SenyB/MgUdH9U=;\n h=DKIM-Signature:Message-ID:From:To:Subject:Date:MIME-Version;\n b=NHDq4DZKVvPErx4ZJjXBQah7Fl8pQVe10CS5KO8lVIwjYhFUUTxP+dJ6YOeIvuj/D1QJTPSVd2ybug93HufAouXxuigoq1jbXli1i2LML897BZa304UPYaHEBvqovZu4UGgUem1rzQjLFgVhsUOWtsOiDIO1xb4UmlerQkboVsw=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512;\n t=1777149549; bh=YY6tmLhu/byKogcyuD81RhMDeOI1InYILopVPH5vvvg=;\n h=From:To:Cc:Subject:Date:Reply-To;\n b=bMJhlLCbqFm8wuaTgSPKYtQpJKK/DlFSZNAxNSGWhvAEDuO/cF5DW7k5GCVJx3Hbl\n kFCTFYAlWeNiIp1vmHL2ckLZAldWOwnITB4M3cZISJ2yFOA0OxA7pdGiN1udmfB1Qa\n fPK7VOjS8fnz9QLkGAuDjfr2drl7aWQLrvrm8og0=","X-QQ-mid":"xmsmtpt1777149547t2y6mw67h","Message-ID":"<tencent_19FEFC275354E2548FA1A484B58368F6800A@qq.com>","X-QQ-XMAILINFO":"NwU6Bou9okj/MDqe3V16/j1Hi4TXablZ03aPNrWK0yVeCc/E/0gW68koucgXqu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CnRCOn9D1NpZuCnCRA==","From":"yxj-github-437 <2457369732@qq.com>","To":"gcc-patches@gcc.gnu.org","Cc":"jason@redhat.com, nathan@acm.org, ppalka@gcc.gnu.org,\n yxj-github-437 <2457369732@qq.com>","Subject":"[PATCH v3] c++,\n contracts: fix testsuite basic.contract.eval.p8 failed","Date":"Sun, 26 Apr 2026 04:36:10 +0800","X-OQ-MSGID":"<20260425203610.188825-1-2457369732@qq.com>","X-Mailer":"git-send-email 2.43.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Reply-To":"tencent_795EFDB353C0E3448CA5A590B713691A810A@qq.com","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"If in a context that is manifestly constant-evaluated ([expr.const]),\na contract violation occurs and the evaluation semantic is terminating\nor contract stmt isnot constant-evaluated, the non_constant_p should be\nset true.\n\ngcc/cp/ChangeLog:\n\t* constexpr.cc (cxx_eval_constant_expression): mark\n\t*non_constant_p true since contract stmt check failed\n---\n gcc/cp/constexpr.cc | 8 +++++++-\n 1 file changed, 7 insertions(+), 1 deletion(-)","diff":"diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc\nindex a593b66dd41..d644299f2b2 100644\n--- a/gcc/cp/constexpr.cc\n+++ b/gcc/cp/constexpr.cc\n@@ -10528,6 +10528,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,\n  \t  {\n  \t    ctx->global->contract_statement = t;\n  \t    ctx->global->contract_condition_non_const = true;\n+\t    *non_constant_p = true;\n  \t    break;\n \t  }\n \n@@ -10550,11 +10551,16 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,\n  \t  {\n  \t    ctx->global->contract_statement = t;\n  \t    ctx->global->contract_condition_non_const = true;\n+\t    *non_constant_p = true;\n  \t    break;\n \t  }\n \t/* Constant, but check failed.  */\n \tif (integer_zerop (eval))\n-\t  ctx->global->contract_statement = t;\n+\t  {\n+\t    ctx->global->contract_statement = t;\n+\t    if (contract_terminating_p (t))\n+\t      *non_constant_p = true;\n+\t  }\n       }\n       break;\n \n","prefixes":["v3"]}