From patchwork Fri Aug 31 09:32:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 964355 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-484844-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="JpHkBY/I"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="g8QjZ+ox"; 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 421vKv5N33z9s1x for ; Fri, 31 Aug 2018 19:33: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=UVwDni8dW/5FEgPhAXp2n4xCMcfwZ+OX5wzDepxgGMUKhD3rqW PSTQqOZKKm7PGvDHUpwO/+fVSL+SAlDb276a0HQcl5LMV3iYyqJJK/oDf2eH7Bl+ Jq1QsGIMqY5FdOJzzhxY3SnX3kx6FkSZZxfgoEgXv5KqGSmoGZbkKeG8Y= 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=GLmYQmMK0+nCr8MENcNUiR7Mz2Y=; b=JpHkBY/IWaI9adb+/5hb XR6eoRA84MEnOMby8OZ6SjhgdYRLhaPGvpCWBsAWP3j85Tp/daxdsizwsbT0f5xn brS58WLf7X5bbrlB0ja0mlA8eJTnodNcr2VIMARNwzOj0atx+0mJl/KtHPwGQndF nIDniMO4NsFYRmdu0ulKXJ4= Received: (qmail 5272 invoked by alias); 31 Aug 2018 09:33: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 5263 invoked by uid 89); 31 Aug 2018 09:32:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=constraint X-HELO: userp2120.oracle.com Received: from userp2120.oracle.com (HELO userp2120.oracle.com) (156.151.31.85) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 31 Aug 2018 09:32:57 +0000 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7V9TDSa083179; Fri, 31 Aug 2018 09:32:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : from : subject : message-id : date : mime-version : content-type; s=corp-2018-07-02; bh=ErUX1iZT2acycmkHT0gXVxl+Hh/4M1o/rSkOtYVCZNM=; b=g8QjZ+oxIxl8m7IHqyq/mrvkAAPyQPAdxes+IgVXXbl9SEUYy+pRId8mcdZZo1VAkme5 x9KFjdfM6N1bPjqhDgxQwaoENcrPsgQw0Fzbyd8i+3umVxb79iVkDOCfkhI41opWkp9e vOyKrwAkDBZ9P/DElx98D4L+0O3OJ9qM4pMPNHpOS5Z2HQipnQNzSqtx0Fp9myG1UA6n ZsqDx1K8VqK22snJbc/HwADRjfSbUj1dL86ncJQLOy6jhZ5P0JtQNEkFa+MDJAfCBQSP 6PHbZHGgkhCaUuwTuUYl8YK+LbjhPu/vwHjl5Uv2G+ruCoL9SeWU547mqMh0116CCfUy og== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2m2yrqsx2a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Aug 2018 09:32:54 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w7V9WrjX027494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Aug 2018 09:32:53 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w7V9Wr7m002454; Fri, 31 Aug 2018 09:32:53 GMT Received: from [192.168.1.4] (/80.117.231.172) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 31 Aug 2018 02:32:52 -0700 To: "gcc-patches@gcc.gnu.org" Cc: Jason Merrill , Nathan Sidwell From: Paolo Carlini Subject: [C++ Patch] PR 84980 ("[concepts] ICE with missing typename in concept") Message-ID: <8166dadf-2c22-631e-2137-600e0b26e923@oracle.com> Date: Fri, 31 Aug 2018 11:32:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 X-IsSubscribed: yes Hi, another straightforward ICE on invalid.  I spent however quite a bit of time on it, because I tried to catch the error_mark_node as early as possible, but that doesn't seem to work well error-recovery-wise: if, say, we catch it in deduce_constrained_parameter we end-up emitting a second redundant "‘C’ is not a type" error message because we skip 'C' completely. Thus, at least for the time being, I propose to simply catch the problem in finish_shorthand_constraint (which likely avoids more ICEs already in Bugzilla...). Tested x86_64-linux. Thanks, Paolo. //////////////////////// /cp 2018-08-31 Paolo Carlini PR c++/84980 * constraint.cc (finish_shorthand_constraint): Early return if the constraint is erroneous. /testsuite 2018-08-31 Paolo Carlini PR c++/84980 * g++.dg/concepts/pr84980.C: New. Index: cp/constraint.cc =================================================================== --- cp/constraint.cc (revision 264009) +++ cp/constraint.cc (working copy) @@ -1259,6 +1259,9 @@ finish_shorthand_constraint (tree decl, tree const if (!constr) return NULL_TREE; + if (error_operand_p (constr)) + return NULL_TREE; + tree proto = CONSTRAINED_PARM_PROTOTYPE (constr); tree con = CONSTRAINED_PARM_CONCEPT (constr); tree args = CONSTRAINED_PARM_EXTRA_ARGS (constr); Index: testsuite/g++.dg/concepts/pr84980.C =================================================================== --- testsuite/g++.dg/concepts/pr84980.C (nonexistent) +++ testsuite/g++.dg/concepts/pr84980.C (working copy) @@ -0,0 +1,6 @@ +// { dg-do compile { target c++14 } } +// { dg-additional-options "-fconcepts" } + +template concept bool C = true; // { dg-error "has not been declared" } + +template struct A;