From patchwork Tue Feb 21 20:50:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 730774 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 3vSXhS5pjjz9s78 for ; Wed, 22 Feb 2017 07:50:48 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="LGWnEq9w"; 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 :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=T3npIczto+0aJuxItQkTBAEcji0sDBIHuJGv0WXLqJMscg Skrks6DFwG+FovJ5H7U2gxMGJzFnwNsVwzavUP6LxCbfsTNgZNdSglDDp3BWOexU /G0PPBiRDXuhL1zjbsdqcGvPjHuwdM+oIcYZKHUPeksgd8aBotsnIECvRx3QQ= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=zHdKzJleC4QZQC5ZFVWlLPxU/pY=; b=LGWnEq9w5bxKImWf1ydg sXiXizp7A68aYf/hfHXvtpUZbr1LGOCwFuPS+0P7cGvV8wEnt1u4yjLUkEzP5NcM 4ri05WUb6LeoSvCSf2mlFVth3cuRik02SRYHk85LIWTEhRdGVnsM08Pu9O0fWnUU Rtah0P1ak4vgUEK41uSSrkU= Received: (qmail 122942 invoked by alias); 21 Feb 2017 20:50:39 -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 122932 invoked by uid 89); 21 Feb 2017 20:50:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.2 spammy= X-HELO: mail-oi0-f41.google.com Received: from mail-oi0-f41.google.com (HELO mail-oi0-f41.google.com) (209.85.218.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Feb 2017 20:50:37 +0000 Received: by mail-oi0-f41.google.com with SMTP id 65so10643325oig.1 for ; Tue, 21 Feb 2017 12:50:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=gnHwrELWrr9d4FQ/Dk7E/N69mAsIMA0QO1HR/DrSR5g=; b=TmgajuIti+L81FY164e9adevlXsbR2crNkNii3xO8DA7UAQdM5Zmt7tMtvf5AI4CNs ckEf4/BDL/fgkh0fLqs7KUHLuYuM02/LyMy4b5GezSj+CzN00+ywXD3SLxCRajSDMtqG FtKOvxepqTdT2bJ966uRuFfzBiDvr/STigt59wrjVQ3BYUUQgX0ZEDwNHtYsUjyF4yTU voMjx1jr1r7uM3xpC3nDY+O9fk0mQNAKJG3kZXtSopBJ8AVNxfjHsZpZWEQcR+SVuO+1 RiVJrNzCtNY98Cf5F1BTG5i+813LtOeA1BSVL2DhsjHPxZXuhOBiQv0q0tQvKNYpNm0G +Gbg== X-Gm-Message-State: AMke39m5d12X4y4h7DgAkcYyPpdqB+Vllx6hRA51yGDWxKurT7XnehRupt5Gnn/nOcitHGGCn7tLEWjPt6di4Mgg X-Received: by 10.202.207.142 with SMTP id f136mr6662282oig.81.1487710235517; Tue, 21 Feb 2017 12:50:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.5.4 with HTTP; Tue, 21 Feb 2017 12:50:14 -0800 (PST) From: Jason Merrill Date: Tue, 21 Feb 2017 12:50:14 -0800 Message-ID: Subject: C++ PATCH for c++/41727, ICE with partial specialization of member of instantiation To: gcc-patches List X-IsSubscribed: yes This was a regression from rejects-valid to ice-on-valid. This patch fixes the ICE, but not the underlying bug. Tested x86_64-pc-linux-gnu, applying to trunk. commit 6788ad9769bfce33d478c426aafbebccdbb5f795 Author: Jason Merrill Date: Tue Feb 21 08:21:55 2017 -0800 PR c++/41727 - ICE with partial spec of partial instantiation * pt.c (process_partial_specialization): For now, don't check more specialized if there is more than one level of args. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2cac24f..475ac1f 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4619,6 +4619,9 @@ process_partial_specialization (tree decl) /* If we aren't in a dependent class, we can actually try deduction. */ else if (tpd.level == 1 + /* FIXME we should be able to handle a partial specialization of a + partial instantiation, but currently we can't (c++/41727). */ + && TMPL_ARGS_DEPTH (specargs) == 1 && !get_partial_spec_bindings (maintmpl, maintmpl, specargs)) { if (permerror (input_location, "partial specialization %qD is not " diff --git a/gcc/testsuite/g++.dg/template/partial-specialization5.C b/gcc/testsuite/g++.dg/template/partial-specialization5.C new file mode 100644 index 0000000..7a8db5a --- /dev/null +++ b/gcc/testsuite/g++.dg/template/partial-specialization5.C @@ -0,0 +1,22 @@ +// PR c++/41727 + +struct tag0; + +template < class Tag > struct outer +{ + template < typename Arg0, typename Arg1 > struct inner; +}; + +template < int Value > struct value_wrap { }; + +template +template < typename Arg0, int Arg1 > +struct outer ::inner < Arg0, value_wrap < Arg1 > > +{ + typedef Arg0 type; +}; + +typedef outer < tag0 > +::inner < tag0, value_wrap < 999 > > +::type // { dg-bogus "incomplete" "" { xfail *-*-* } } + outer_inner_type;