From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58611 invoked by alias); 23 Apr 2015 15:50:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 57831 invoked by uid 89); 23 Apr 2015 15:50:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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; Thu, 23 Apr 2015 15:50:52 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3NFoo0n006634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 23 Apr 2015 11:50:50 -0400 Received: from [10.10.116.45] ([10.10.116.45]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3NFoodU029241 for ; Thu, 23 Apr 2015 11:50:50 -0400 Message-ID: <553914D5.8010805@redhat.com> Date: Thu, 23 Apr 2015 15:50:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: gcc-patches List Subject: Re: C++ PATCH for c++/65646 (ICE after error specializing missing static data member) References: <551C1E71.9080501@redhat.com> In-Reply-To: <551C1E71.9080501@redhat.com> Content-Type: multipart/mixed; boundary="------------020003040605030107050903" X-SW-Source: 2015-04/txt/msg01429.txt.bz2 This is a multi-part message in MIME format. --------------020003040605030107050903 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 465 On 04/01/2015 12:36 PM, Jason Merrill wrote: > This testcase started crashing because the added call to > check_explicit_specialization does a SET_DECL_TEMPLATE_SPECIALIZATION > which wasn't happening previously, and then determine_visibility assumes > that if DECL_USE_TEMPLATE is set, so is DECL_TEMPLATE_INFO. Fixed for > GCC 5 by avoiding the call if we aren't dealing with a member template. And fixed for GCC 6 by adjusting check_explicit_specialization. --------------020003040605030107050903 Content-Type: text/x-patch; name="65646-2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="65646-2.patch" Content-length: 1259 commit a7205fbf919d0f460c278843159bb068745406dc Author: Jason Merrill Date: Wed Apr 1 12:48:40 2015 -0400 PR c++/65646 * pt.c (check_explicit_specialization): Don't SET_DECL_TEMPLATE_SPECIALIZATION for a variable with no template headers. * decl.c (grokvardecl): Revert earlier fix. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 29d6e73..6ec1579 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8210,9 +8210,7 @@ grokvardecl (tree type, DECL_INTERFACE_KNOWN (decl) = 1; // Handle explicit specializations and instantiations of variable templates. - if (orig_declarator - /* For GCC 5 fix 65646 this way. */ - && current_tmpl_spec_kind (template_count) != tsk_none) + if (orig_declarator) decl = check_explicit_specialization (orig_declarator, decl, template_count, 0); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d45fe7c..ea0d3bc 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2424,7 +2424,7 @@ check_explicit_specialization (tree declarator, switch (tsk) { case tsk_none: - if (processing_specialization) + if (processing_specialization && TREE_CODE (decl) != VAR_DECL) { specialization = 1; SET_DECL_TEMPLATE_SPECIALIZATION (decl); --------------020003040605030107050903--