From patchwork Wed Feb 10 17:40:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 581514 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 90824140783 for ; Thu, 11 Feb 2016 04:40:56 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=tPN9yqn9; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=WnTNGnI7gAzUTHX7sJq+nO1DtBkOXEFoOBk3vBvGa/DmmFC9xU GTDWmuipeRlgYYFo9b4EuvJi1Cov1mN9y5XMBnP5ZjEZ+gr9P/epu3+ou78Gb8Ve mps5CpOXxxu8ANsqMmH1Mm824XV1eiswcSfml/RZXrARbyYFnP4Rkk+Yw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=EPRCo3klqjeVVhzSrdETU87gMtw=; b=tPN9yqn9noA9AGofSAOX IG1Jg0RAMOhXbUs4hoxjjHiDQit4c3y39VOii2mHT3Z5k1Bney7sdhCqY44h5Zgk hvaXmAClJuzLThznQ8MChtjk/gLBVTzL9YO4u6z1WIBaoGl55WvZmP9klCleu0oK hDBnNZsKNFvK4s0/4eveBsM= Received: (qmail 26759 invoked by alias); 10 Feb 2016 17:40:47 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 26699 invoked by uid 89); 10 Feb 2016 17:40:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1863 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 10 Feb 2016 17:40:42 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id B8037146E8E for ; Wed, 10 Feb 2016 17:40:41 +0000 (UTC) Received: from localhost (ovpn-116-36.ams2.redhat.com [10.36.116.36]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1AHeeBI028870; Wed, 10 Feb 2016 12:40:41 -0500 Date: Wed, 10 Feb 2016 17:40:40 +0000 From: Jonathan Wakely To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: [patch] c++/61198 backport to gcc-4.9 Message-ID: <20160210174040.GL8441@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.24 (2015-08-30) I wanted to backport r232232 (aka 2edb91b1) which helps with the compile-time regression tracked by PR60976. On the gcc-4.9 branch it produces lots of ICEs due to PR61198, which was only fixed for gcc-5. This backports the PR61198 fix to the 4.9 branch, which resolves the ICEs I'm seeing and so would let me also backport the libstdc++ change. Is this safe for 4.9? Tested powerpc64le-linux, no new failures. commit d98a90afa73cecd8c62a93381cde2077471753f2 Author: Jonathan Wakely Date: Wed Feb 10 12:41:26 2016 +0000 Backport PR c++/61198 fix gcc: 2014-12-19 Kai Tietz PR c++/61198 * pt.c (most_general_template): Don't break for template-alias. gcc/testsuite: 2014-12-19 Kai Tietz Paolo Carlini PR c++/61198 * g++.dg/cpp0x/alias-decl-45.C: New file. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 60e9671..7485b95 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -18873,6 +18873,7 @@ most_general_template (tree decl) break; if (CLASS_TYPE_P (TREE_TYPE (decl)) + && !TYPE_DECL_ALIAS_P (TYPE_NAME (TREE_TYPE (decl))) && CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl))) break; diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-45.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-45.C new file mode 100644 index 0000000..e3434f5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-45.C @@ -0,0 +1,24 @@ +// PR c++/61198 +// { dg-do compile { target c++11 } } + +template +struct broken +{ + template + using rebind = broken; +}; + +template +struct broken<2, derp_t> +{ + template + using rebind = broken<2, target_t>; +}; + +int main(int argc, char **argv) +{ + broken<2, float>::rebind u; + + return 0; +} +