From patchwork Fri Mar 8 11:27:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 226090 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 D18962C03CA for ; Fri, 8 Mar 2013 22:28:48 +1100 (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=1363346929; 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=5TGBnddLHEwJ/uOF7cStM0knME0=; b=e6gX6mt7NA4BIBY h18mOiqI72HcybrIBhi5pPhnCpBV0g6JSzhSPRWvyIjCFDMzIviHewN+23B23CDI 8SDPw4X8PGhbKxGmcVgQInbefKIaNw+ui3pVJo4Z3fQDjEYqVHUuZxiHKnxYp2s6 EFTW8dxgDPLCQXWAfCd1i28lN4I8= 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=lhgwaZzuQUuGa5uGBsvRAubELY16MHYUjYPkJSGavUZiN8BTr2I1rfHgBKA42c xnv548GE/ZOVm0cXoS/Xde6jcgIcZGm1naqvHGdquJinFLddo19hcCu8gUl9GDNo dXIvk5ovS9Qbb/R1lS8xTLPdPDHFd8Ftyw57wN08P8XfU=; Received: (qmail 28701 invoked by alias); 8 Mar 2013 11:28:40 -0000 Received: (qmail 28692 invoked by uid 22791); 8 Mar 2013 11:28:39 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL, BAYES_00, FSL_NEW_HELO_USER, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, TW_CX X-Spam-Check-By: sourceware.org Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Mar 2013 11:28:07 +0000 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r28BS0Zu030812 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Mar 2013 11:28:01 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 r28BS0tf027866 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Mar 2013 11:28:00 GMT Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r28BRx98001541; Fri, 8 Mar 2013 05:27:59 -0600 Received: from [192.168.1.4] (/79.33.222.15) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 08 Mar 2013 03:27:59 -0800 Message-ID: <5139CB3D.90201@oracle.com> Date: Fri, 08 Mar 2013 12:27:57 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: gdr@axiomatics.org, Jason Merrill Subject: [C++ Patch] PR 51412 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, today I noticed that I still have assigned this rather simple diagnostic issue, where LAMBDA_EXPR is unhandled by our pretty printing code. I suppose we can make at least some progress for 4.8.0. Is the below goo enough for now? Tested x86_64-linux. Thanks, Paolo. ////////////////////// /cp 2013-03-08 Paolo Carlini PR c++/51412 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR. * error.c (dump_expr): Likewise. /testsuite 2013-03-08 Paolo Carlini PR c++/51412 * g++.dg/cpp0x/lambda/lambda-err3.C: New. Index: cp/cxx-pretty-print.c =================================================================== --- cp/cxx-pretty-print.c (revision 196540) +++ cp/cxx-pretty-print.c (working copy) @@ -1162,6 +1162,10 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) } } break; + + case LAMBDA_EXPR: + pp_cxx_ws_string (pp, ""); + break; default: pp_c_expression (pp_c_base (pp), t); Index: cp/error.c =================================================================== --- cp/error.c (revision 196540) +++ cp/error.c (working copy) @@ -2494,6 +2494,10 @@ dump_expr (tree t, int flags) dump_expr (resolve_virtual_fun_from_obj_type_ref (t), flags); break; + case LAMBDA_EXPR: + pp_string (cxx_pp, M_("")); + break; + /* This list is incomplete, but should suffice for now. It is very important that `sorry' does not call `report_error_function'. That could cause an infinite loop. */ Index: testsuite/g++.dg/cpp0x/lambda/lambda-err3.C =================================================================== --- testsuite/g++.dg/cpp0x/lambda/lambda-err3.C (revision 0) +++ testsuite/g++.dg/cpp0x/lambda/lambda-err3.C (working copy) @@ -0,0 +1,10 @@ +// PR c++/51412 +// { dg-do compile { target c++11 } } + +void foo(int); + +template void bar() +{ + foo([]{}...); // { dg-error "" } + foo([]{}=0 ...); // { dg-error "" } +}