From patchwork Wed Oct 25 13:04:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 1855049 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=icEQgAtt; 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 4SFq0d4f1rz23jV for ; Thu, 26 Oct 2023 00:05:21 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E57B3857027 for ; Wed, 25 Oct 2023 13:05:19 +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 CAC803857C44 for ; Wed, 25 Oct 2023 13:05:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CAC803857C44 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 CAC803857C44 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=1698239108; cv=none; b=TPPXit8yRBQ9pILwvcd+1EjdPJn/TeSdWtir1xH5LKE332jOB6agy114O5qFJFu4lOt+tQx2bhN9ynAKrk3Afs3TLhlbEU6cM1+A+Q1vbsz4JzyLec4ivNPrd/gTLPX55DoJBYpz7pej5awdHBKFR97wlvSRe5idvgxI+Id0GL8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698239108; c=relaxed/simple; bh=4HLPq9V/aX6emwizPbDH65/nCY2JFVqPc1aECcSN9Zc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WSLFGazj01lYXxW2gbsHxPZK8V0NrL2mO5jUAe++H0+ETZ4t9vpQteiwGjsp6P3P25MTB1XNV3i+A91Qa7bO+bKCXxzGuh4fm2HW8uyDy8uxuyW+aykienH9oUP1QgULqfuhCmt8jHNH5MUqlOZOYCaGoIxLf7GuwYaORvC9mUk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698239107; 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=8MruZvGoZ5JEn3B0uorMvk/lXOtGoIuaOGHmQpfefyk=; b=icEQgAttNtuQDAHwWDPV9XlnGgNaV93wxz74hpUAZOoRgyW8E7VIdvVFiK8q/bZ27VLtxE /8XRCuCJNDSBLJvaja/7Je+OV3yLyuON2wxfa+5JH8FnedDbuewnLO5yCOn7XVYsNUg9jS lqEIHBbwDiV0po1hNOrWBw6GAVZK7bM= Received: from mail-oo1-f69.google.com (mail-oo1-f69.google.com [209.85.161.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-275-PacfbdvxMqSpQf6O1x9PLQ-1; Wed, 25 Oct 2023 09:05:05 -0400 X-MC-Unique: PacfbdvxMqSpQf6O1x9PLQ-1 Received: by mail-oo1-f69.google.com with SMTP id 006d021491bc7-581e2c9197bso7692455eaf.3 for ; Wed, 25 Oct 2023 06:05:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698239104; x=1698843904; 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=8MruZvGoZ5JEn3B0uorMvk/lXOtGoIuaOGHmQpfefyk=; b=D1IYtR3WBZj+AvyRUquh01MVFZHPKAe3jmVweQOdj6Ml4I/wX1BAo1pwMXen3pt1/p XvuUl4SfvmYQvA+Ihn6kRCpNY9Sd70Lfc9rk7VfjHpKcGQ7vn4no/h0x1Vd5uffswmD/ a8Zap0rWJuNqSJRRjhoj4E7wFAHGeVSrC1pwdeSHYyUCqXlJ4iyaTHJ4zWIcVMMfWz+o a+9e1I2WmDVw2dn+PWS7JS65zhSC47Am54500C9tefu1dHGbLPexIk2/w0+c3Zq/k+qi ePS07oPx1tyVGwo92LCW9IIUYXxMU+ONfOzGKst/E1qmQ0FFECdKrnx8cedS+xjf7LXc sSCg== X-Gm-Message-State: AOJu0Yy9j93uVf70yzIgPAme9LaIgtLBNMuv6quQuQK+Lg+rrnQG7Ah7 DwqVRmvG3w9gYiBGgY+CAxTfXxLRCtRuWdgNk8yAvO4Eq5GdiL5q4lUO3M2nnK84wdiaCyjajD8 a9QJXnN0uFc/vpt7t4PLFKNhx0L+0Yu7v9/ZfnTtfktfQjHJrZ7WO0oD5HwdNs1Gi2OtOr7OkCL w= X-Received: by 2002:a05:6870:ed91:b0:1dc:9714:e2b3 with SMTP id fz17-20020a056870ed9100b001dc9714e2b3mr21132263oab.7.1698239104044; Wed, 25 Oct 2023 06:05:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVPl+NjeI6hphB+mTfCcvGiAqHyPKBG0EfUXChsm4ZzrpZIh+4F/oGovSLrHMnt8jFAWHICQ== X-Received: by 2002:a05:6870:ed91:b0:1dc:9714:e2b3 with SMTP id fz17-20020a056870ed9100b001dc9714e2b3mr21132232oab.7.1698239103679; Wed, 25 Oct 2023 06:05:03 -0700 (PDT) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id dr20-20020a05621408f400b0065af24495easm4419735qvb.51.2023.10.25.06.04.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 06:04:53 -0700 (PDT) From: Patrick Palka To: gcc-patches@gcc.gnu.org Cc: jason@redhat.com, Patrick Palka Subject: [pushed] c++: add fixed testcase [PR99804] Date: Wed, 25 Oct 2023 09:04:29 -0400 Message-ID: <20231025130429.107577-1-ppalka@redhat.com> X-Mailer: git-send-email 2.42.0.482.g2e8e77cbac MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.6 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_H4, 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: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Tested on x86_64-pc-linux-gnu, pushed to trunk. -- >8 -- We accept the non-dependent call f(e) here ever since the NON_DEPENDENT_EXPR removal patch r14-4793-gdad311874ac3b3. I haven't looked closely into why but I suspect wrapping 'e' in a NON_DEPENDENT_EXPR was causing the argument conversion to misbehave. PR c++/99804 gcc/testsuite/ChangeLog: * g++.dg/template/enum9.C: New test. --- gcc/testsuite/g++.dg/template/enum9.C | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 gcc/testsuite/g++.dg/template/enum9.C diff --git a/gcc/testsuite/g++.dg/template/enum9.C b/gcc/testsuite/g++.dg/template/enum9.C new file mode 100644 index 00000000000..c992cd505c2 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/enum9.C @@ -0,0 +1,12 @@ +// PR c++/99804 + +struct S { + enum E { A, B } e : 1; + void f(E); + template void g() { f(e); } +}; + +int main() { + S s; + s.g(); +}