From patchwork Thu Dec 9 11:56:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 74877 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 B0ABBB70A7 for ; Thu, 9 Dec 2010 22:57:06 +1100 (EST) Received: (qmail 16561 invoked by alias); 9 Dec 2010 11:57:05 -0000 Received: (qmail 16542 invoked by uid 22791); 9 Dec 2010 11:57:04 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from vsmtp1.tin.it (HELO vsmtp1.tin.it) (212.216.176.141) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Dec 2010 11:56:56 +0000 Received: from [192.168.0.4] (79.43.213.149) by vsmtp1.tin.it (8.0.022) id 4CFE55C7002BE908; Thu, 9 Dec 2010 12:56:53 +0100 Message-ID: <4D00C405.5030305@oracle.com> Date: Thu, 09 Dec 2010 12:56:53 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101026 SUSE/3.0.10 Thunderbird/3.0.10 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch] PR 42083 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, I have this patchlet for an ICE on invalid. Tested x86_64-linux. Ok for mainline? Thanks, Paolo. ////////////////////// /cp 2010-12-09 Paolo Carlini PR c++/42083 * init.c (build_value_init): Check build_special_member_call return value for error_mark_node. /testsuite 2010-12-09 Paolo Carlini PR c++/42083 * g++.dg/cpp0x/lambda/lambda-ice2.C: New. Index: testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C =================================================================== --- testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C (revision 0) +++ testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C (revision 0) @@ -0,0 +1,16 @@ +// PR c++/42083 +// { dg-options "-std=c++0x" } + +template +decltype(F()) run(F f) // { dg-message "note" } +{ + return f(); +} + +int main() +{ + auto l = []() { return 5; }; + + run(l); // { dg-error "no match" } + // { dg-message "candidate" "candidate note" { target *-*-* } 14 } +} Index: cp/init.c =================================================================== --- cp/init.c (revision 167632) +++ cp/init.c (working copy) @@ -314,9 +314,11 @@ build_value_init (tree type, tsubst_flags_t compla tree ctor = build_special_member_call (NULL_TREE, complete_ctor_identifier, NULL, type, LOOKUP_NORMAL, complain); - - ctor = build_aggr_init_expr (type, ctor); - AGGR_INIT_ZERO_FIRST (ctor) = 1; + if (ctor != error_mark_node) + { + ctor = build_aggr_init_expr (type, ctor); + AGGR_INIT_ZERO_FIRST (ctor) = 1; + } return ctor; } }