From patchwork Tue Apr 17 19:58:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 899622 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-476505-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="v6mMnfB0"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Qbg03xY7z9s19 for ; Wed, 18 Apr 2018 05:59:07 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=kkzk7M2vQ4BeDy4EBSMQuo4v0eQ1cOX7m7U3WXgKx9x2TIq5Kv PumMo0uD4Lqin9iACpx2WbwCm/QBQYt0pYvel7GiXrDIqSc6h/GO4FIVxrpApdA8 NebjhpxkcHf8UZrhs+45+s+3N6dTnlr7Mc5OhGfdONr+Vi1jW+J1NmXn8= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=uAyeMCT6ljFT/ECnO1+bOFdcxcM=; b=v6mMnfB06w1B8+CgFljv t9bYvlq9GNKViIH7VHwozLhN++Kh1BFoTkduoLAwFYrfb9dWuXjUNzuEoMSpOlHI St4RZF5hY9S5MJ0cHLjjpCvwOqtygGL0KkQQOcpcQdqgzNxTvgwJrZ2BezdhEgnP 6wvNlFOqMThK2uRWayD/ihQ= Received: (qmail 102038 invoked by alias); 17 Apr 2018 19:59:00 -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 102011 invoked by uid 89); 17 Apr 2018 19:58:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*Ad:D*oracle.com, H*r:Gateway X-HELO: aserp2120.oracle.com Received: from aserp2120.oracle.com (HELO aserp2120.oracle.com) (141.146.126.78) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Apr 2018 19:58:58 +0000 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3HJtapU043136; Tue, 17 Apr 2018 19:58:56 GMT Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2hbamnusr7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Apr 2018 19:58:56 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w3HJwte3023306 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Apr 2018 19:58:55 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w3HJws1X015850; Tue, 17 Apr 2018 19:58:54 GMT Received: from [192.168.1.4] (/62.211.207.61) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 Apr 2018 12:58:54 -0700 To: "gcc-patches@gcc.gnu.org" Cc: Jason Merrill From: Paolo Carlini Subject: [C++ Patch] PR 84630 ("[6/7/8 Regression] ICE: TYPE_NAME() used on error_mark_node in tsubst_lambda_expr, at cp/pt.c:17141") Message-ID: Date: Tue, 17 Apr 2018 21:58:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8866 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804170174 X-IsSubscribed: yes Hi, this one seems easy: just check the return value of begin_lambda_type for error_mark_node - exactly like we do in the parser - and avoid ICEing immediately after for the submitted snippet. Tested x86_64-linux. Thanks, Paolo. ////////////////////// /cp 2018-04-17 Paolo Carlini PR c++/84630 * pt.c (tsubst_lambda_expr): Check begin_lambda_type return value for error_mark_node. /testsuite 2018-04-17 Paolo Carlini PR c++/84630 * g++.dg/cpp0x/pr84630.C: New. Index: cp/pt.c =================================================================== --- cp/pt.c (revision 259444) +++ cp/pt.c (working copy) @@ -17281,6 +17281,8 @@ tsubst_lambda_expr (tree t, tree args, tsubst_flag } tree type = begin_lambda_type (r); + if (type == error_mark_node) + return error_mark_node; /* Do this again now that LAMBDA_EXPR_EXTRA_SCOPE is set. */ determine_visibility (TYPE_NAME (type)); Index: testsuite/g++.dg/cpp0x/pr84630.C =================================================================== --- testsuite/g++.dg/cpp0x/pr84630.C (nonexistent) +++ testsuite/g++.dg/cpp0x/pr84630.C (working copy) @@ -0,0 +1,7 @@ +// PR c++/84630 +// { dg-do compile { target c++11 } } + +template struct c { + template __attribute__((noinline([] {}))) int b(); // { dg-error "wrong number of arguments" } +}; +c<> a;