From patchwork Thu Sep 14 13:32:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 139589 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp352056vqi; Thu, 14 Sep 2023 06:33:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfAec60IggN8SF49P8dj5qMdtbJrNnT/kl3RanVcBWna67/y1xFTs3WBTf3O+AgzzKd6pm X-Received: by 2002:a17:907:2c5b:b0:9a5:d972:af50 with SMTP id hf27-20020a1709072c5b00b009a5d972af50mr4409683ejc.19.1694698433768; Thu, 14 Sep 2023 06:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694698433; cv=none; d=google.com; s=arc-20160816; b=Y6CqrQ62EDzDyQ3bqHwXEmMkdeLRsiL+ugpQeA8WI0DQ1Q8Yrka0K/DDboLVpU2H6l Uck6tMWvDBZ0fQXqZc+sPBMF324Je9sBSXcAMjjjuVd4B1z0ROBofLG31hjlUXOd+FL0 MLoTwxt4pCafosF79UvNQIsI0EllpHVjyQXwJggs0SGPAcS1IC3QTwGSrNzQU7OyNpd+ UFVvZpAcRg1B9+5AgSuQ2kAi6vZgI0QL3KdeCxwAbojPPEICUePHKAVNbe3Qw83Aee1T v3JSB2RbgdppVvJrYPYlo2nd6oMjBcHF4i45Ko/kEu/iRzHQOtXiL1xOND2U3UNGobdr Bjvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=LDxp/CIoyi5fdG9uJgxwiPtlgM6FiloQ+FvzeGOPAjI=; fh=sJ+2/4g29YdyXkoRrFZSpsL2zxijepB7X/1rB0LDDh8=; b=SKeHaa0tToYC4hteBx5Zy4n7IJ8GMC6NJO9ERG7PpzNOHoS6HAYSdsJTTPRNh/vEVR af8ynV7sfSMQObhEWW6+f8QII9EAl53tMhmZePhfxSWrY+j/2dzMNwPZXQJvH4mNY8N+ 15mYNWKI3c6+qaQ6Axa9ppSYx6fRSDowxp98/wrHwGqohE9D3ceBldEU1A4YEjbE/9CP /DgR7mQ27VxfGAw6bzYzUjecPZ0n3Ll9TqEhj7uA/p2j/2H88H4OIah4DbQIiAWqeHlu h8lJwwnxKXBDOHVDJIDJ650ozs+f3mlhnmBvLI2ARng6TtKDHJcbZZF/xtlIGRJLCjiR cEVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="b/BT0RIE"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ck17-20020a170906c45100b009a1b857e3b7si1471240ejb.481.2023.09.14.06.33.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 06:33:53 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="b/BT0RIE"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7FF693855594 for ; Thu, 14 Sep 2023 13:33:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FF693855594 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694698407; bh=LDxp/CIoyi5fdG9uJgxwiPtlgM6FiloQ+FvzeGOPAjI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=b/BT0RIEVE8UhqVgF2dyYjohsWYC3/gDMCUJV26r3uqw5cOwm4FEqnhPIcIEyxh0k 1cNhrrmeYV6umxUM6vNbJElPtbu5tp3tUc2MOdY0ADGjon7oR9yKaQrwL5D7FoqhDF H6Q3Ym8tafudOdwdSEEP+TciSctPBgNdR7sHPOPc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 6E5843858298 for ; Thu, 14 Sep 2023 13:32:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6E5843858298 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-634-lvPb9vIvMgWs26owBsW9MQ-1; Thu, 14 Sep 2023 09:32:39 -0400 X-MC-Unique: lvPb9vIvMgWs26owBsW9MQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0AFCA805B3E; Thu, 14 Sep 2023 13:32:39 +0000 (UTC) Received: from localhost (unknown [10.42.28.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE6AF40C6EA8; Thu, 14 Sep 2023 13:32:38 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Add testcase for std::make_integer_sequence bug [PR111357] Date: Thu, 14 Sep 2023 14:32:15 +0100 Message-ID: <20230914133238.2165790-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777020104773820172 X-GMAIL-MSGID: 1777020104773820172 Tested aarch64-linux. Pushed to trunk. I'll backport the test and a library workaround to the release branches. -- >8 -- The compiler bug has been fixed on trunk, but this adds a regression test for the library component. libstdc++-v3/ChangeLog: PR c++/111357 * testsuite/20_util/integer_sequence/pr111357.cc: New test. --- .../20_util/integer_sequence/pr111357.cc | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 libstdc++-v3/testsuite/20_util/integer_sequence/pr111357.cc diff --git a/libstdc++-v3/testsuite/20_util/integer_sequence/pr111357.cc b/libstdc++-v3/testsuite/20_util/integer_sequence/pr111357.cc new file mode 100644 index 00000000000..1ad06b732af --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/integer_sequence/pr111357.cc @@ -0,0 +1,34 @@ +// { dg-do compile { target c++14 } } + +// PR c++/111357 - __integer_pack fails to work with values of dependent type +// convertible to integers in noexcept context + +#include + +using std::integer_sequence; +using std::make_integer_sequence; + +template +void g(integer_sequence) +{} + +template +struct c1 +{ + static constexpr int value = 1; + constexpr operator int() { return value; } +}; + +template +struct R +{ + using S = make_integer_sequence{}>; + + R() noexcept(noexcept(g(S()))) // { dg-bogus "argument to .__integer_pack." } + {} +}; + +int main() +{ + R(); +}