From patchwork Wed Feb 10 22:46:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 581723 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F0FD314031B for ; Thu, 11 Feb 2016 09:46:17 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=fKok0Hg+; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=cCcqVY3wpP+VvAsv0Lmc3Ik83HNhzubUZT7B6o19ci9TjNVhrT SRb5tTzNvFBYOoXgp8nbg11b9FjfecgkMqXIB3nQkl744rIHsoaULLSyWh0W6XiV PMbrxyzihYmcrTi0j9wMWofJEINIoXTL9vX8+1dOwZVq8e4lDBWCvvRes= 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 :from:subject:message-id:date:mime-version:content-type; s= default; bh=nB/oO2y5y5sdDIOCysxdcY+geU8=; b=fKok0Hg+B3jbDmvposaF XZUHnC0lKQQq7gDhNjfcmKEHsCz6HTuZoJHDg+VaoJ+aCvMcd7QTSbdnrUJxDIVb cib/PyYbyXmH/TITT3Ac3SRBolw2+8tjAuARb1i3XI9f1riOHnH7Z7S1R0qLTNW4 DAtx4iAqyzi463FndU4CeAg= Received: (qmail 19227 invoked by alias); 10 Feb 2016 22:46:10 -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 19212 invoked by uid 89); 10 Feb 2016 22:46:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=BAYES_00, KAM_ASCII_DIVIDERS, RP_MATCHES_RCVD, SPF_PASS autolearn=no version=3.3.2 spammy=H*r:ip*192.168.1.4, H*Ad:D*oracle.com, Hx-spam-relays-external:192.168.1.4, H*RU:192.168.1.4 X-HELO: userp1040.oracle.com Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 10 Feb 2016 22:46:08 +0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1AMk6Ms008684 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 10 Feb 2016 22:46:06 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u1AMk6tu021966 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 10 Feb 2016 22:46:06 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u1AMk6lD016025 for ; Wed, 10 Feb 2016 22:46:06 GMT Received: from [192.168.1.4] (/79.30.176.80) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 10 Feb 2016 14:46:06 -0800 To: gcc-patches@gcc.gnu.org From: Paolo Carlini Subject: [C++ Patch] PR 68726 ("ice: tree check: expected tree_vec, have error_mark in comp_template_args_with_info, at cp/pt.c:7890") Message-ID: <56BBBDAB.40203@oracle.com> Date: Wed, 10 Feb 2016 23:46:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi, turns out, this small ICE on invalid is actually a regression, I can only reproduce it in trunk. Anyway, the ICE occurs immediately when, during error recovery, comp_template_args gets an error_mark_node as second argument. Tested x86_64-linux. Thanks, Paolo. P.S. Second try: the first time my message was rejected as spam!?! /////////// /cp 2016-02-10 Paolo Carlini PR c++/68726 * pt.c (lookup_template_class_1): Check tsubst return value for error_mark_node. /testsuite 2016-02-10 Paolo Carlini PR c++/68726 * g++.dg/cpp0x/pr68726.C: New. Index: cp/pt.c =================================================================== --- cp/pt.c (revision 233308) +++ cp/pt.c (working copy) @@ -8547,6 +8547,8 @@ lookup_template_class_1 (tree d1, tree arglist, tr arglist, complain, NULL_TREE); --processing_template_decl; TREE_VEC_LENGTH (arglist)++; + if (partial_inst_args == error_mark_node) + return error_mark_node; use_partial_inst_tmpl = /*...and we must not be looking at the partial instantiation itself. */ Index: testsuite/g++.dg/cpp0x/pr68726.C =================================================================== --- testsuite/g++.dg/cpp0x/pr68726.C (revision 0) +++ testsuite/g++.dg/cpp0x/pr68726.C (working copy) @@ -0,0 +1,7 @@ +// { dg-do compile { target c++11 } } + +template struct A { + template struct __construct_helper; // { dg-error "expected" } + template + using __has_construct typename __construct_helper<_Args...>::type; // { dg-error "expected" } +} struct : A { // { dg-error "expected" }