From patchwork Fri Jun 7 00:56:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 249573 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id D35C42C0095 for ; Fri, 7 Jun 2013 10:57:13 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=CKBuSKhW1wGpJBil8NwEIpcX3jdJkUiy/LasjHfTRWT WOyHX4Vjgi/Rhap+vlkiwHxZusoo1iWtNaR3TICDnBEkddxiNG5TzNNGTtgEL+T3 VjJpxqk+2mqOOpVcB5PEIBAIomJFiVhancucmKELrCyruB6l0lqJEN4hbnQQZkhs = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=6ks8UQDk6Ess0TMGC8zz6OJzMNM=; b=Yb5ciGE9pHviOBjz8 k4zHaX1BcxxUZv/8dB5ucPEK+wlPjsrHox6/h5RBeML1+yUtAlHYJa25JxQkNgPY 7eRymlvF0qYWF9VhZ8auC5Ng54geQGk4epkuWDlMEzykgtDLvgDBiUuVOdfp0TwH vEhsTVjIll9uBtgHOCYDQidFQo= Received: (qmail 5877 invoked by alias); 7 Jun 2013 00:57:07 -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 3221 invoked by uid 89); 7 Jun 2013 00:57:00 -0000 X-Spam-SWARE-Status: No, score=-5.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_HOSTKARMA_NO, RP_MATCHES_RCVD, SPF_PASS, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 07 Jun 2013 00:56:59 +0000 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r570usxD002617 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 7 Jun 2013 00:56:54 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r570utuQ025609 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 7 Jun 2013 00:56:55 GMT Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r570utgE013807; Fri, 7 Jun 2013 00:56:55 GMT Received: from poldo4.casa (/79.33.221.36) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 06 Jun 2013 17:56:55 -0700 Message-ID: <51B12FD5.3010007@oracle.com> Date: Fri, 07 Jun 2013 02:56:53 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch] PR 53658 X-Virus-Found: No Hi, this issue seems just another case of: http://gcc.gnu.org/ml/gcc-patches/2012-10/msg02472.html thus we are ICEing because TYPE_STUB_DECL is null and we want to use TYPE_MAIN_DECL. Tested x86_64-linux. Thanks, Paolo. /////////////////////// /cp 2013-06-07 Paolo Carlini PR c++/53658 * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL, not TYPE_STUB_DECL, to access the _DECL for a _TYPE. /testsuite 2013-06-07 Paolo Carlini PR c++/53658 * g++.dg/cpp0x/alias-decl-36.C: New. Index: cp/pt.c =================================================================== --- cp/pt.c (revision 199776) +++ cp/pt.c (working copy) @@ -7561,7 +7561,7 @@ lookup_template_class_1 (tree d1, tree arglist, tr if (CLASS_TYPE_P (template_type) && is_dependent_type) /* If the type makes use of template parameters, the code that generates debugging information will crash. */ - DECL_IGNORED_P (TYPE_STUB_DECL (t)) = 1; + DECL_IGNORED_P (TYPE_MAIN_DECL (t)) = 1; /* Possibly limit visibility based on template args. */ TREE_PUBLIC (type_decl) = 1; Index: testsuite/g++.dg/cpp0x/alias-decl-36.C =================================================================== --- testsuite/g++.dg/cpp0x/alias-decl-36.C (revision 0) +++ testsuite/g++.dg/cpp0x/alias-decl-36.C (working copy) @@ -0,0 +1,6 @@ +// PR c++/53658 +// { dg-do compile { target c++11 } } + +struct A; +template using Foo = const A; +template Foo bar();