From patchwork Fri Feb 16 17:45:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 1900211 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=cz182ssd; 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 4Tbzqc3L5Sz23hy for ; Sat, 17 Feb 2024 04:45:47 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D04253857B99 for ; Fri, 16 Feb 2024 17:45:44 +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 ESMTPS id 893CD3857B86 for ; Fri, 16 Feb 2024 17:45:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 893CD3857B86 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 893CD3857B86 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=1708105526; cv=none; b=e2fstU5EI7nsm5WBeA03xXUl86M/sCNwPDeg+EW22PUosRpEUxP5kDtznug5Bni+/MI6QCzqUpscT9KlO5zKaMFLSpE4xBRcPspzrP8q8l3A+Q/YemsjY9cCMwCIMYl9jBq8Y8AvXOU/jvsyTJdfHp563Q3Q9JD5dOU5ig7pFw0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708105526; c=relaxed/simple; bh=Ac26Wmp5XewoxLKV3NO9bFQhvDQ6AYmGnHMglMngZx0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=v1f7M+gM94W7zIK7WISJ9rOVkfuUYdVamaCBbFrjv90OvJMnz0NdRIElhSbEDj6LANJDPNdtfxSmJLYs8k5UZKD3UXlsq/yVYPOUqahcqFy7atUlGUUE4OByAHWk701078qW2mtJTbfkbYqQT4459/msqbgDj/GbcjY8banr4Zc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708105525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3AsDyaT9xeuaqehKwp3QgbK1Mm3ZNDksIFLU3djjCAw=; b=cz182ssdKG5WYCW8FO1e6baF888EzotmLjbmjWOEPaY/HA+qmCxMhWBqSDKiVRl3lm59k9 lZ6KAbIEvNbAn8KQ0UZQV33hjLs1LU7ybi44QScfpu96K0x3MSiiJa8dWX5MN4DGQEg9zK WXKrM4CaeXimO5YVx1tyJ8GLJbPxL2g= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-617-vxykZGvrN4Cxi2_enb-2hg-1; Fri, 16 Feb 2024 12:45:24 -0500 X-MC-Unique: vxykZGvrN4Cxi2_enb-2hg-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-68eecf368a4so28321106d6.0 for ; Fri, 16 Feb 2024 09:45:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708105523; x=1708710323; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3AsDyaT9xeuaqehKwp3QgbK1Mm3ZNDksIFLU3djjCAw=; b=ucO1IsGXz3Vt0XZKhvifxc1jSFe5zlhd1+NOsBeFKhKIl7Enw03ISPFw/Fa0G2qf5H LLfshfcqk5MHc0y+1XrSN3dnJRR+XCmXBJj0+7mKMExoxkBh0aUs60w0e90v6tL2H00B q7pjLYonZks5tMrOwCTwZHjJPDLPAh3I4h6XaHv7T7nWfOeaj5sTVy3H3surbXcWOVeP Q1YA5E27prfvycGpgfonku9ImXRWWi9Lxvj2V9JV7/hcYwfD38ThzDXCwS32BUFesB0c ZFEVytPNDP6P6PELsNboWaUpIUfkeP/tDGj5SYHqJ53AMAc5QExXl/rJLWH3ZgLPH4nX 6RcQ== X-Gm-Message-State: AOJu0YxTAT6H3CUp3tcYiJJHlGYznPRPoMUxcTMjS0dEhux1wSvPFc10 +roK/hZSw7zwW6rVKSsF6k0PG/qRaCLNTRooie0pEy5WYkKVKTfgyIygS1HkiV6JPuMIFijXhlN x98N6Yx3zMB6uHTQXyZ/JH9HFwryn96vdQ/NbCFyx3yFb9IuGnjayyrW+40Hwx4m5QtWx+GmLJa SxWd/j64fk//4onmKfyu6yvm12Qf1jInDxKI4L X-Received: by 2002:a0c:e3d3:0:b0:68f:2ed:bfd2 with SMTP id e19-20020a0ce3d3000000b0068f02edbfd2mr5395182qvl.30.1708105522953; Fri, 16 Feb 2024 09:45:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVq2VtZFCPOAGLma6yZ5UfIa+RyiBzk2jme5I7+cMXChuV3dhSUwPsnL8Fg5/SsOpQu2Yw2w== X-Received: by 2002:a0c:e3d3:0:b0:68f:2ed:bfd2 with SMTP id e19-20020a0ce3d3000000b0068f02edbfd2mr5395163qvl.30.1708105522668; Fri, 16 Feb 2024 09:45:22 -0800 (PST) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id dg10-20020a056214084a00b0068f3327ef6asm120058qvb.37.2024.02.16.09.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:45:22 -0800 (PST) From: Patrick Palka To: gcc-patches@gcc.gnu.org Cc: jason@redhat.com, Patrick Palka Subject: [pushed] c++: add fixed testcase [PR111682] Date: Fri, 16 Feb 2024 12:45:18 -0500 Message-ID: <20240216174518.455856-1-ppalka@redhat.com> X-Mailer: git-send-email 2.44.0.rc1.15.g4fc51f00ef MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.0 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_H2, RCVD_IN_SORBS_WEB, 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 Fixed by the PR113612 fix r14-8960-g19ac327de421fe. PR c++/111682 gcc/testsuite/ChangeLog: * g++.dg/cpp1y/var-templ86.C: New test. --- gcc/testsuite/g++.dg/cpp1y/var-templ86.C | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/var-templ86.C diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ86.C b/gcc/testsuite/g++.dg/cpp1y/var-templ86.C new file mode 100644 index 00000000000..0c933cac26c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/var-templ86.C @@ -0,0 +1,23 @@ +// PR c++/111682 +// { dg-do compile { target c++14 } } + +template struct A { + template struct B; + template struct B; +}; +template template struct A::B {}; +template struct A; +A::B b; + + +template struct B { + template static const int var1; + template static const int var1; + + template static const int var2; +}; +template template const int B::var1 = 1; +template template const int B::var2 = 1; +template struct B; +int b_test1[B::var1]; +int b_test2[B::var2];