From patchwork Tue Feb 15 05:06:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1592914 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=acY0TKVf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JyTbY40NWz9ryY for ; Tue, 15 Feb 2022 16:07:03 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6E4F83858432 for ; Tue, 15 Feb 2022 05:07:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E4F83858432 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1644901620; bh=3yZIdbVvafpen8yRiTLNd805IJpTdgzsNDUURIT+Zvc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=acY0TKVfuzITJQlT6wMfwpD49Xdd4Ij6tUAONMKAEJUuOvNHO4PV7MrctQKQ6+PDa cdr4alVB/qK/JhrzpT3t5lUexzAAQzxb/id4/17bXpOo189HBhPZEDbzv16fn4YxTq PgEiBkVbbkfZGIypmhpn6Dca7HjoNcfEN/k/Mm/o= 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 967403858D20 for ; Tue, 15 Feb 2022 05:06:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 967403858D20 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-275-ie72hcFwOjmnuqf3Y33_1g-1; Tue, 15 Feb 2022 00:06:31 -0500 X-MC-Unique: ie72hcFwOjmnuqf3Y33_1g-1 Received: by mail-qv1-f69.google.com with SMTP id jr12-20020a0562142a8c00b0042d7901650cso3397945qvb.17 for ; Mon, 14 Feb 2022 21:06:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=3yZIdbVvafpen8yRiTLNd805IJpTdgzsNDUURIT+Zvc=; b=2oKN4hq9To0X2nUEIurO7AVib/UYGv4Ngj4t1tZll2UpcFT2SIp5p7Ni4hn8wC8A7h 9WbwKDWasEqJNrHljosaOaxz7tSH5ppbCfMb5ZZQx2NJSwJmWZ7oSyCrn7/++Ov3zjLw X8Ai5TRouy6zRVyzzO9yVxVH6PSBZuVrK/WUB7eDR4JNuXtLsbMM8CaYOwELNnRevpJf /Z7hrlTTR2R0TYua2Ik67rApP1wIjHtZFZR6BUMUWKJBys2X/FGbUDjuiackHP1fqp4S V0TGNUJogHS/SE/n5smC0rFt8doY1KMfYyZ+ukV7I/rRCL4fNdyJVhbBRt/fVK/d2ioY NNAQ== X-Gm-Message-State: AOAM532fSoclPG5eTm7WDBEV4LQeI3uSDUpfnNldzfZqhKv745L6xiS9 PaydcYQNzSmvBl7S2SloJANDI8cxt41r9O1ylyXWhk3yBEENSgMmqPXuCDxddjOP//kDLdZ5sIq FlUGVlumuGjLuf7bEqm6YrT1RPgxQqWv5cpoCg4JEzKUv1XWWgUPhiv+XyH1ATyamvA== X-Received: by 2002:ad4:4ea6:: with SMTP id ed6mr1322204qvb.106.1644901590669; Mon, 14 Feb 2022 21:06:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/51YBtmY3J2X6jKp2FJh6Ds3vDApXKzM2ZhCMUndoVD8WQlKTOF57gONeK6jlhZ5Y5R/pYw== X-Received: by 2002:ad4:4ea6:: with SMTP id ed6mr1322191qvb.106.1644901590180; Mon, 14 Feb 2022 21:06:30 -0800 (PST) Received: from barrymore.redhat.com (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id r2sm19486691qta.15.2022.02.14.21.06.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 21:06:29 -0800 (PST) To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: TTP in member alias template [PR104107] Date: Tue, 15 Feb 2022 00:06:27 -0500 Message-Id: <20220215050627.1742376-1-jason@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.1 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, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Patchwork-Original-From: Jason Merrill via Gcc-patches From: Jason Merrill Reply-To: Jason Merrill Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" In the first testcase, coerce_template_template_parms was adding too much of outer_args when coercing to match P's template parameters, so that when substituting into the 'const T&' parameter we got an unrelated template argument for T. We should only add outer_args when the argument template is a nested template. Tested x86_64-pc-linux-gnu, applying to trunk. PR c++/104107 PR c++/95036 gcc/cp/ChangeLog: * pt.cc (coerce_template_template_parms): Take full parms. Avoid adding too much of outer_args. (coerce_template_template_parm): Adjust. (template_template_parm_bindings_ok_p): Adjust. (convert_template_argument): Adjust. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/alias-decl-ttp2.C: New test. * g++.dg/cpp1z/ttp2.C: New test. --- gcc/cp/pt.cc | 41 +++++++++++++++----- gcc/testsuite/g++.dg/cpp0x/alias-decl-ttp2.C | 25 ++++++++++++ gcc/testsuite/g++.dg/cpp1z/ttp2.C | 21 ++++++++++ 3 files changed, 77 insertions(+), 10 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-ttp2.C create mode 100644 gcc/testsuite/g++.dg/cpp1z/ttp2.C base-commit: f320197c8b495324dc6997a99d53e7f45ecf5840 diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 1b18e2a7787..6dda66081bd 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -7731,8 +7731,8 @@ coerce_template_template_parm (tree parm, template