From patchwork Tue Dec 22 21:33:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 560282 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 B16521402C9 for ; Wed, 23 Dec 2015 08:33:20 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=G699DkPg; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=HPXuIe+RrVB8CmYTW+pGhmqbCnZt+u44Lzhyx8KMcJwgrGZYZi 176BhaKXLUkqoXMdcqLuFuyxafMbR6j7AtBRFDRz5Ivlz9jiOQ0nQ2J7kHhUELbM vvjV3xdJ6wisUNQw+Dp5kpX31B8CfWRmNCVDLGXpmfntwsM42lPcMXhg4= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=4L1nRHkTBJnvQgnVKCGMqsaT1VQ=; b=G699DkPg7tHhiem1BmYO BOZAynpdIlgsg3R41857fvlOGdUC6hwJMoFOdyVNOAvEFVpOvlhPHCmZQ8T2vR80 K5XC6Hewvwx3Mlrhu4EOD9GZGbYExPuRnp/MeGtWltmApDynJRfK38V1sIKMF1ns mSIsp0Q0CFcny7Ef+m3yk7o= Received: (qmail 128030 invoked by alias); 22 Dec 2015 21:33:12 -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 127969 invoked by uid 89); 22 Dec 2015 21:33:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Indicate, declared, 1, 16 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; Tue, 22 Dec 2015 21:33:11 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 0933414CABF for ; Tue, 22 Dec 2015 21:33:09 +0000 (UTC) Received: from [10.10.116.53] (ovpn-116-53.rdu2.redhat.com [10.10.116.53]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBMLX8AD013864 for ; Tue, 22 Dec 2015 16:33:09 -0500 To: gcc-patches List From: Jason Merrill Subject: C++ PATCH for c++/67339 (ICE with alias to PMF) Message-ID: <5679C194.8030808@redhat.com> Date: Tue, 22 Dec 2015 16:33:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 We can't assume that a RECORD_TYPE has TYPE_LANG_SPECIFIC anymore. Tested x86_64-pc-linux-gnu, applying to trunk and 5. commit dafb66bbcf0fd6ef503e3573b2b315230d054c0e Author: Jason Merrill Date: Mon Dec 21 12:31:22 2015 -0500 PR c++/67339 * parser.c (cp_parser_elaborated_type_specifier): Use CLASS_TYPE_P rather than check for RECORD_TYPE. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index c1948c4..262bfb2 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -16880,7 +16880,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, { /* Indicate whether this class was declared as a `class' or as a `struct'. */ - if (TREE_CODE (type) == RECORD_TYPE) + if (CLASS_TYPE_P (type)) CLASSTYPE_DECLARED_CLASS (type) = (tag_type == class_type); cp_parser_check_class_key (tag_type, type); } diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-pmf1.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-pmf1.C new file mode 100644 index 0000000..d0ac27d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-pmf1.C @@ -0,0 +1,16 @@ +// PR c++/67339 +// { dg-do compile { target c++11 } } + +template < typename T> +struct A +{ + void foo(); + template < typename S, typename W > + using N = void (T::*)(S, W) const ; +}; + +template < typename T> +void A::foo() +{ + typename A::template N fun = &T::out; +}