From patchwork Wed Sep 19 15:55:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 185090 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]) by ozlabs.org (Postfix) with SMTP id 008282C0085 for ; Thu, 20 Sep 2012 01:55:59 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1348674960; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Message-ID:Date:From:User-Agent:MIME-Version: To:CC:Subject:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=LB2F9l98Z8vyiTtHAQGZlA/QH2c=; b=HlzM/7iJm48utB/ mgCT/7jRZ7gY+dFH2qwJwSnWiwtp09jvuYPXMZQ9CfvlEvi8Fi2kmu5KxQLHnNyA cWtP1VFlFO8Ze+K1P5xkaavJfeAnVzeyzICo4zBFShNrXTSXgxiu6q4zFXbqnUHH 8sUz3yaponhFAQCnsNBkoITlV9cQ= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=q1pMCI1s9GYHr3JL6N6Z5vR2lGmwKswX1d+k/XyZlqlIpzRBkA95ARaaWm+tuP 54Q2OnUMsuWVRNOg68RCEWlw06MKORUV4EjBL+NlF+dWUkkwdTbWB1K/CEz/HGFR 1oIXW1dJ7xsUSIuDwXoge7yGCIWJp9h3ZtZyGkT5ZCTNg=; Received: (qmail 2609 invoked by alias); 19 Sep 2012 15:55:55 -0000 Received: (qmail 2596 invoked by uid 22791); 19 Sep 2012 15:55:54 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com) (141.146.126.227) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Sep 2012 15:55:41 +0000 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q8JFtd9F024350 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 Sep 2012 15:55:40 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q8JFtcjb019296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Sep 2012 15:55:39 GMT Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q8JFtcYP010985; Wed, 19 Sep 2012 10:55:38 -0500 Received: from [192.168.1.4] (/79.36.29.90) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 19 Sep 2012 08:55:38 -0700 Message-ID: <5059EAF8.7030501@oracle.com> Date: Wed, 19 Sep 2012 17:55:36 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch / RFC] PR 52432 X-IsSubscribed: yes 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 Hi all, Jason, the large testcase attached by Jon to this PR triggers an "Internal compiler error: Error reporting routines re-entered." from -fdump-tree-gimple. The immediate cause seems obvious: in one place in tsubst_copy_and_build we are calling unqualified_name_lookup_error unconditionally, thus irrespective of complain. Changing that indeed avoids the ICE. Then I come to the existing testcase which doesn't pass as-is: it's the testcase added by Jason as part of fixing 50075, which, as analyzed by Jason himself, was clearly about an endless recursion. Currently, however, we error out with that unqualified_name_lookup_error, once, and we don't mention the recursion in the error message. With the patchlet applied, the diagnostics actually shows the recursion, and we error out few lines above in tsubst_copy_and_build, with the error messages koenig lookup related. That makes some sense to me, but the testcase needs tweaking. Thanks, Paolo. //////////////////////// Index: testsuite/g++.dg/cpp0x/decltype32.C =================================================================== --- testsuite/g++.dg/cpp0x/decltype32.C (revision 191479) +++ testsuite/g++.dg/cpp0x/decltype32.C (working copy) @@ -3,10 +3,10 @@ template auto make_array(const T& il) -> -decltype(make_array(il)) // { dg-error "not declared" } +decltype(make_array(il)) // { dg-error "not declared|no matching|exceeds" } { } int main() { - int z = make_array(1); // { dg-error "no match" } + int z = make_array(1); // { dg-error "no matching" } } Index: cp/pt.c =================================================================== --- cp/pt.c (revision 191483) +++ cp/pt.c (working copy) @@ -13771,7 +13771,8 @@ tsubst_copy_and_build (tree t, } if (TREE_CODE (function) == IDENTIFIER_NODE) { - unqualified_name_lookup_error (function); + if (complain & tf_error) + unqualified_name_lookup_error (function); release_tree_vector (call_args); RETURN (error_mark_node); }