From patchwork Tue Jul 26 09:54:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 106820 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 C5535B70C0 for ; Tue, 26 Jul 2011 19:54:49 +1000 (EST) Received: (qmail 31569 invoked by alias); 26 Jul 2011 09:54:45 -0000 Received: (qmail 31560 invoked by uid 22791); 26 Jul 2011 09:54:44 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, TW_WR X-Spam-Check-By: sourceware.org Received: from rcsinet15.oracle.com (HELO rcsinet15.oracle.com) (148.87.113.117) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 26 Jul 2011 09:54:28 +0000 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p6Q9sPVn009482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 26 Jul 2011 09:54:27 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p6Q9sOCW018234 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 26 Jul 2011 09:54:25 GMT Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p6Q9sJ50011551; Tue, 26 Jul 2011 04:54:19 -0500 Received: from [192.168.1.4] (/79.51.25.215) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 26 Jul 2011 02:54:19 -0700 Message-ID: <4E2E8EC3.2060109@oracle.com> Date: Tue, 26 Jul 2011 11:54:11 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch] PR 49776 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, another simple fix for an ICE on invalid. Tested x86_64-linux. Ok? Thanks, Paolo. //////////////////////// /cp 2011-07-26 Paolo Carlini PR c++/49776 * typeck.c (cp_build_modify_expr): Check digest_init return value for error_mark_node. /testsuite 2011-07-26 Paolo Carlini PR c++/49776 * g++.dg/cpp0x/constexpr-49776.C: New. Index: testsuite/g++.dg/cpp0x/constexpr-49776.C =================================================================== --- testsuite/g++.dg/cpp0x/constexpr-49776.C (revision 0) +++ testsuite/g++.dg/cpp0x/constexpr-49776.C (revision 0) @@ -0,0 +1,17 @@ +// PR c++/49776 +// { dg-options -std=c++0x } + +struct s +{ + int i[1]; + + template + constexpr s(Types... args) + : i{args...} // { dg-error "cannot convert" } + { } +}; + +int main() +{ + s test = nullptr; +} Index: cp/typeck.c =================================================================== --- cp/typeck.c (revision 176786) +++ cp/typeck.c (working copy) @@ -6753,6 +6753,8 @@ cp_build_modify_expr (tree lhs, enum tree_code mod if (check_array_initializer (lhs, lhstype, newrhs)) return error_mark_node; newrhs = digest_init (lhstype, newrhs, complain); + if (newrhs == error_mark_node) + return error_mark_node; } else if (!same_or_base_type_p (TYPE_MAIN_VARIANT (lhstype),