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 [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 204223850419 for ; Mon, 8 Mar 2021 20:29:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 204223850419 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-446-3cMpshK1OCe8tUtbTFKK7g-1; Mon, 08 Mar 2021 15:29:17 -0500 X-MC-Unique: 3cMpshK1OCe8tUtbTFKK7g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3F7811009E2D for ; Mon, 8 Mar 2021 20:29:16 +0000 (UTC) Received: from pdp-11.redhat.com (ovpn-118-26.rdu2.redhat.com [10.10.118.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE8D319D9D for ; Mon, 8 Mar 2021 20:29:15 +0000 (UTC) From: Marek Polacek To: GCC Patches Subject: [pushed] c++: Add test for PR96268. Date: Mon, 8 Mar 2021 15:29:11 -0500 Message-Id: <20210308202911.43097-1-polacek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-14.7 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_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2021 20:29:20 -0000 This works since the recent r11-7102, but we didn't have a test for a template-argument context. Tested x86_64-pc-linux-gnu, applying to trunk. gcc/testsuite/ChangeLog: PR c++/96268 * g++.dg/cpp2a/nontype-class41.C: New test. --- gcc/testsuite/g++.dg/cpp2a/nontype-class41.C | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp2a/nontype-class41.C diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class41.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class41.C new file mode 100644 index 00000000000..2be88437072 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class41.C @@ -0,0 +1,13 @@ +// PR c++/96268 +// { dg-do compile { target c++20 } } + +template +struct static_string { char chars[N]; /* operator<=> */ }; + +template +static_string(char const(&)[N]) -> static_string; + +static_string hi = {"hi"}; + +template struct name {}; +using Hi = name<{"hi"}>; base-commit: bc56d27de97ecea813279ce5ba45b278dcccfe21 -- 2.29.2