From patchwork Thu Feb 15 14:29:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 873902 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-473339-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="QkDIik34"; 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 3zhzFM55pkz9sRm for ; Fri, 16 Feb 2018 01:29:58 +1100 (AEDT) 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=C/OgHxsWjBBRAihYDsS7v9tLKDdYPPyW9/bYsQwQ555jMRHfms 5o1/htzxNFSAlRAxAbqDgnqF9O7T6eQR6NAaPcFmWMtl7P1nhLVTf9yKMbQsVqXF YKDGBFVNW9+k7YRL85NpU8rJUJUfcitwGbSyKmqqPkEO9TG6xZ4kPh4sQ= 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=5ez1oIkOio7dkim9SlKYYGVCI1s=; b=QkDIik34Y++l4/S6LEkP yQ7Wd8jQqsDD39vnhUYA95whpyAMhtJtqR9lexfurwvMXlL2Chi3fckIclK+QI11 TbnuGS1zzPRHWmdDruSeQ22uiBuOa/MgxJZ6+bhxg1VtoKwFTw4Qz+975FUl3xmc ocUr4PAyINZykKSMgFANnaA= Received: (qmail 79223 invoked by alias); 15 Feb 2018 14:29:51 -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 79166 invoked by uid 89); 15 Feb 2018 14:29:47 -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, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= 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; Thu, 15 Feb 2018 14:29:45 +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 w1FERCVv126614; Thu, 15 Feb 2018 14:29:41 GMT Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2g5awt8dt5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2018 14:29:41 +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 w1FETcPb010186 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 15 Feb 2018 14:29:40 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w1FETcPE012670; Thu, 15 Feb 2018 14:29:38 GMT Received: from [192.168.1.4] (/79.52.198.133) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Feb 2018 06:29:37 -0800 To: "gcc-patches@gcc.gnu.org" Cc: Jason Merrill From: Paolo Carlini Subject: [C++ Patch] PR 84330 ("[6/7/8 Regression] [concepts] ICE with broken constraint") Message-ID: <727ee55c-b5ec-e502-3c49-4ded00f11e3d@oracle.com> Date: Thu, 15 Feb 2018 15:29:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8805 signatures=668671 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-1802150179 X-IsSubscribed: yes Hi, we have been accumulating quite a few bugs under the [concepts] meta-bug, most of which of course aren't regressions. This one is a low hanging fruit, an error recovery issue where, after some meaningful diagnostic, tsubst_constraint doesn't know how to handle an error_mark_node. I believe that ideally we should do better, we should be able to issue only the first error - I think a TODO in diagnose_constraint hints at that too - but the below should do for now (well, in 6.1.0 we issued *3* errors ;-) Thanks, Paolo. //////////////////// /cp 2018-02-15 Paolo Carlini PR c++/84330 * constraint.cc (tsubst_constraint_info): Handle an error_mark_node as first argument. /testsuite 2018-02-15 Paolo Carlini PR c++/84330 * g++.dg/concepts/pr84330.C: New. Index: cp/constraint.cc =================================================================== --- cp/constraint.cc (revision 257682) +++ cp/constraint.cc (working copy) @@ -1918,7 +1918,7 @@ tsubst_constraint_info (tree t, tree args, tree tsubst_constraint (tree t, tree args, tsubst_flags_t complain, tree in_decl) { - if (t == NULL_TREE) + if (t == NULL_TREE || t == error_mark_node) return t; switch (TREE_CODE (t)) { Index: testsuite/g++.dg/concepts/pr84330.C =================================================================== --- testsuite/g++.dg/concepts/pr84330.C (nonexistent) +++ testsuite/g++.dg/concepts/pr84330.C (working copy) @@ -0,0 +1,12 @@ +// PR c++/84330 +// { dg-options "-fconcepts" } + +struct A +{ + template requires sizeof(T) >> 0 void foo(T); // { dg-error "predicate constraint" } + + void bar() + { + foo(0); // { dg-error "no matching" } + } +};