From patchwork Fri Aug 30 20:36:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 1979221 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bSEriZNU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4WwVMH6r71z1yfn for ; Sat, 31 Aug 2024 06:37:30 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7CE3B386486F for ; Fri, 30 Aug 2024 20:37:28 +0000 (GMT) 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.129.124]) by sourceware.org (Postfix) with ESMTP id 36B2A386480F for ; Fri, 30 Aug 2024 20:36:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 36B2A386480F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 36B2A386480F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725050193; cv=none; b=UmC0MRCnXIOGKdb4hCHB+/X79YcvDl1DZ+NZ2oIrPvI9Yi87KP9eU7acNuj/17fbA24OUHGBOAeW+RwpWpu7iN1W6RNtIrBi7lrI6lioEeaPOcpqGUjXRiD4alAkqxWJ7wXTOBdGDFqTlzHnf61X/VIwz+aZEv0pJVQqqceNksw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725050193; c=relaxed/simple; bh=8Al8fesOA9CLl81kFWpKaZw+Zy+lNogm+6Dpy6WjQS4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=LgDJ7/DE9QjBe01h9Mvd6ZRehiy5qRBTDUuiEtdv6N1oa/l8PLhAcGHVXys/1+1fg67VXOMm/GWQY1G+CHPxR3EszoLioIDeAwOFw8fWH1o0a7jB7jjAPV9vYf7rz9G4OTqABU9lVdShZk4yn0lftmPvms4jPhfGL4jFx4za98k= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725050191; 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=nMK2baJzfScr7/2lZjslOUwg7vL4g9C19MR+LCg0sLY=; b=bSEriZNUwMRJN/IO4H7QAEgjnl/l7oadQGa14SYizdwZAJomC8qWhT5c4eQ8NbHynyih/V PlQjo/iK5Z64pDYF9oaRPTPmoMR4SXH8RD56d2wqe+yWuMQ6Rt0RgfzyJwlyFaRD1Fw0C+ TXKk7MledzZG1X/7GdTEpwv77YqxPcA= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-531--sMUXc-iPcy75kpRoTJLFA-1; Fri, 30 Aug 2024 16:36:29 -0400 X-MC-Unique: -sMUXc-iPcy75kpRoTJLFA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B804C1954B0A for ; Fri, 30 Aug 2024 20:36:28 +0000 (UTC) Received: from pdp-11.redhat.com (unknown [10.22.16.233]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 255361955F44 for ; Fri, 30 Aug 2024 20:36:27 +0000 (UTC) From: Marek Polacek To: GCC Patches Subject: [pushed] c++: add fixed test [PR115616] Date: Fri, 30 Aug 2024 16:36:25 -0400 Message-ID: <20240830203625.900878-1-polacek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 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, T_SCC_BODY_TEXT_LINE 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: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- This got fixed by r15-2120. PR c++/115616 gcc/testsuite/ChangeLog: * g++.dg/template/friend83.C: New test. --- gcc/testsuite/g++.dg/template/friend83.C | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 gcc/testsuite/g++.dg/template/friend83.C base-commit: f93a38f3fc8b20942896d037f3833d6b383dd3d8 diff --git a/gcc/testsuite/g++.dg/template/friend83.C b/gcc/testsuite/g++.dg/template/friend83.C new file mode 100644 index 00000000000..edd29614b31 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/friend83.C @@ -0,0 +1,24 @@ +// PR c++/115616 +// { dg-do compile { target c++20 } } + +template void bar() {} + +template +struct Reader +{ + template + friend void foo(Reader); +}; + +template +struct Writer +{ + template + friend void foo(Reader) {bar();} +}; + +int main() +{ + foo<10>(Reader{}); + Writer{}; +}