From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 41390385783F for ; Thu, 14 Sep 2023 13:32:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 41390385783F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694698363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LDxp/CIoyi5fdG9uJgxwiPtlgM6FiloQ+FvzeGOPAjI=; b=d2FSsb1LvqtM3xaYgAavIeW8sQpsEql7DrqbY4CjDZFDvCEGsmgs3yzgqHWfWLKvWZN/4q 8LqYXWdYbp84qycA6qrTjW+nrAHwjX79c57mA7KvlBgg1gqH7cAZMrmJUKctVBzfXXHqRO dzWii30f5pKiv8+XemAddqsfRHHEBKs= 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) From: Jonathan Wakely 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 Content-Type: text/plain Content-Transfer-Encoding: 8bit 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=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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(); +} -- 2.41.0