From patchwork Fri Aug 2 10:39:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1968294 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=irBP2n9A; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wb2QM1BFPz1yZl for ; Fri, 2 Aug 2024 20:39:39 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 042C43858D35 for ; Fri, 2 Aug 2024 10:39:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 3F3ED3858D35 for ; Fri, 2 Aug 2024 10:39:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3F3ED3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3F3ED3858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722595155; cv=none; b=ZoK80A3C+sL9umHA3kaP/HRm91PWAhaRxMsOfLbVHcLY2cj6KpUnlI+IypNBkCV9YMZtOyU1Gafuzw/knF5UrbHTCnAhkpWimB/XO0ViRxCsCgA1IEXylAoAx2nT/OAyn+pXpDu8pIQu46vt4fgANu9WRoxeAOfzPvRepPN/df0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722595155; c=relaxed/simple; bh=ojhOQaabeC9hU0Hc0+bedJ0k6jISXThmjgKCHdRDUB4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=n60PvGXBx9PAM2dUYQp7y/ezsY0l75OjTToO8ztx5nAox/PsI0O3CIisg7UyRd3u0Wr9kjLQDeoFOsWOm3soah7+rsZga2h3QDoHxz/yDDgx+DdLkVP0svLn7ezryUIQOZaivjPZ8rNCOMRz6zn/DyoQEdtl8UPG6iPXKo2Xi8I= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4266f3e0df8so51154615e9.2 for ; Fri, 02 Aug 2024 03:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722595152; x=1723199952; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=82T+uIydDT8ghY07KSlSOwRMPTZsCjg3a7vZ/w5E3Mo=; b=irBP2n9AXX500Jpmo4MqN5iVV5sw1PEykLWiNgfHv6YIXW9+MA7VDWd5z+/MjAowSh +0q8qErmVs8iiLmefFPdJofe5Sux4AgSlYUJowdkRnHsVIOSBNbh6kGUWiLtm/TxVxY8 gNsC2rthBs/UXqm+nIgxRDh1YZkaEo23sAcX1VChX/u1cXpY45tW2+TonqxSwgMPSMFA SDNrGI0vd8OPugmwIboXRTI/iWiSe6IgQzIY4ujh99PVM+HDcD3iYULcoZk1YxkMAU98 bBrkQIgfjNtMJVPtbsQPzpDN4R5zJOBTfSLZrYz94p3+I4+FxDHxLDunhIIxYUds0Z7f 1nkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722595152; x=1723199952; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=82T+uIydDT8ghY07KSlSOwRMPTZsCjg3a7vZ/w5E3Mo=; b=UEB3rIwLINxBkhfReS2s+FIcTWqb+tLpx0SpJAnX3+s0w6wy5Kw31ey+WXQe/o8MQn 2j7SAc5hAyHozRWySVTRchzYLMlPLVB2jKk9ibR6r8LfosL/uHEF6P2J+p/UnkBkzjrv x4QOUuOTFMPbmek5BGzgKs6GPv7L6MBeseIHoAGIgV7uVNruHrdUGHRL+z/HO5yc9vGw /YqjA45yjTJ9z7HNv+Z3HTHoi/oCMgFVomNtr0belgw8drMRQe0rPqxNfShMbOBKeH5a 4K32Gnpaz165XH/FLnc7WpQRN/tEDlqcePeiSvM/uVD6uPBfrFzR3/ndDKdS4TPpQnq0 V/Qw== X-Gm-Message-State: AOJu0YzsPCXhDL50xf8/kNXWS8pseg50+PBGCmFHEmTDtBhwRLS8zs4c 8gJZC0QZpeEUNE5TWivNNwozSyvu2tfqelny+jXymRMfxNbwC6R6rEvEkD/3 X-Google-Smtp-Source: AGHT+IE5XasyDRhmg1bYMwMhjjj/tZdpP6OzZWkkQYahzjVrf0cPddRyG4mndDZUEtEwotH2AdCY5g== X-Received: by 2002:a05:600c:1c14:b0:426:5e8e:410a with SMTP id 5b1f17b1804b1-428ea0fd6a8mr12509205e9.24.1722595151350; Fri, 02 Aug 2024 03:39:11 -0700 (PDT) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd028842sm1627800f8f.61.2024.08.02.03.39.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 02 Aug 2024 03:39:11 -0700 (PDT) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] c++, coroutines: Fix a typo in checking for void expression types. Date: Fri, 2 Aug 2024 11:39:10 +0100 Message-Id: <20240802103910.40918-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.39.2 (Apple Git-143) MIME-Version: 1.0 X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: iain@sandoe.co.uk Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org tested on x86_64-darwin and linux, pushed to trunk as obvious, thanks, Iain --- 8< --- The current code fails to check for void expression types because it does not lookup the type. Fixed thus. gcc/cp/ChangeLog: * coroutines.cc (replace_continue): Look up expression type. Signed-off-by: Iain Sandoe --- gcc/cp/coroutines.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc index 91bbe6b0a0e..9c1e5f0c5d7 100644 --- a/gcc/cp/coroutines.cc +++ b/gcc/cp/coroutines.cc @@ -3433,7 +3433,7 @@ replace_continue (tree *stmt, int *do_subtree, void *d) tree expr = *stmt; if (TREE_CODE (expr) == CLEANUP_POINT_EXPR) expr = TREE_OPERAND (expr, 0); - if (CONVERT_EXPR_P (expr) && VOID_TYPE_P (expr)) + if (CONVERT_EXPR_P (expr) && VOID_TYPE_P (TREE_TYPE (expr))) expr = TREE_OPERAND (expr, 0); STRIP_NOPS (expr); if (!STATEMENT_CLASS_P (expr))