From patchwork Mon Sep 30 20:23:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 279254 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 did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B057C2C010C for ; Tue, 1 Oct 2013 06:24:08 +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=bn9Xivfjqi50VEXxiIOfYBMzcDLthQ+PkMj67LlJR/L CpUrHXP+PRoNDpZ3oOgQAZtgwJZD4zWDI3t9gYRKgAP6dAANelWegjOniF5hE6XZ kmDoIN1TzWlz/Y9V44KV0hUw5PNm9AEbr3NZzONVjNTMr8lbJp8FSE7g3wDAejTE = 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=W30kIqXj2fu7OklI/dYMh+I1sDs=; b=OPwgBWR0cvNDlyJL5 e/OKz+9MWHzsuetrR5goRP3fOtX7k0iJvLAe9hwmkWLE55iPLUcVtnHOF4VQG6Ny JFuIswuJDeJjm+jJwk8oAq+0ELnP3TWqhoEhGTuP5QeF1Ho4tBCWVFemr+riRlkb GmCtDL8vIlbu6K0B3p055BUWAc= Received: (qmail 24613 invoked by alias); 30 Sep 2013 20:24:02 -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 24601 invoked by uid 89); 30 Sep 2013 20:24:02 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 30 Sep 2013 20:24:02 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_SOFTFAIL, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-HELO: aserp1040.oracle.com Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r8UKNw0D015994 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 30 Sep 2013 20:23:58 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8UKNvsP003305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Sep 2013 20:23:58 GMT Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8UKNvJw003302; Mon, 30 Sep 2013 20:23:57 GMT Received: from poldo4.casa (/79.33.222.127) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 30 Sep 2013 13:23:57 -0700 Message-ID: <5249DDDB.1080604@oracle.com> Date: Mon, 30 Sep 2013 22:23:55 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch] PR 58563 X-IsSubscribed: yes Hi, this ICE seems easy to avoid: just check the return value of make_typename_type for error_mark_node, like we normally do everywhere else in the parser. Tested x86_64-linux. Thanks, Paolo. /////////////////////////// /cp 2013-09-30 Paolo Carlini PR c++/58563 * parser.c (cp_parser_lookup_name): Check make_typename_type return value for error_mark_node. /testsuite 2013-09-30 Paolo Carlini PR c++/58563 * g++.dg/cpp0x/pr58563.C: New. Index: cp/parser.c =================================================================== --- cp/parser.c (revision 203037) +++ cp/parser.c (working copy) @@ -21756,7 +21756,8 @@ cp_parser_lookup_name (cp_parser *parser, tree nam is dependent. */ type = make_typename_type (parser->scope, name, tag_type, /*complain=*/tf_error); - decl = TYPE_NAME (type); + if (type != error_mark_node) + decl = TYPE_NAME (type); } else if (is_template && (cp_parser_next_token_ends_template_argument_p (parser) Index: testsuite/g++.dg/cpp0x/pr58563.C =================================================================== --- testsuite/g++.dg/cpp0x/pr58563.C (revision 0) +++ testsuite/g++.dg/cpp0x/pr58563.C (working copy) @@ -0,0 +1,8 @@ +// PR c++/58563 +// { dg-do compile { target c++11 } } + +template void foo() +{ + enum E {}; + E().E::~T(); // { dg-error "not a class" } +}