From patchwork Sat Nov 18 02:52:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 839204 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-467249-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="se/42Xmv"; 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 3ydzy71LBzz9s72 for ; Sat, 18 Nov 2017 13:51:11 +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:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=l7+hhVzOCwE9gp9h2tn+YXoqgWHO6aKsCrK1sikR6yUvSCjLbkutg F1qJdiMjg8ScxAH1op/mOw1hYLiznh5XPcHYGXr0JtSyKS/yNEtht/5FKddrdeg+ Nu58umrVaQ7OBNM+z+/i2lzHVcaNOEhsn+Ybdkj5UAewo0yMZtdxhk= 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:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=NcbcIoO+Mf2B628uvxDCJNbWERI=; b=se/42Xmvgwss86zkdUL+ PuA0aOBDlMlYa4WzUJHgAAdUhqBRyBFXZwr0k85yiJN3j711tArTNQy/mVKqleYL nKLF9ojwrqHbm+TSOR6wnRRVNux588zwnUAkfZaFqM7Toe7kn+kvR2ixnAsJQS9p bvwyhbEOS0ZJSK03ezCQG8k= Received: (qmail 67496 invoked by alias); 18 Nov 2017 02:50:43 -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 67432 invoked by uid 89); 18 Nov 2017 02:50:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KB_WAM_FROM_NAME_SINGLEWORD, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1201 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 18 Nov 2017 02:50:41 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7008F7EBD6; Sat, 18 Nov 2017 02:50:40 +0000 (UTC) Received: from c64.redhat.com (ovpn-112-13.phx2.redhat.com [10.3.112.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4DD76A025; Sat, 18 Nov 2017 02:50:38 +0000 (UTC) From: David Malcolm To: Jason Merrill Cc: Nathan Sidwell , Jakub Jelinek , Richard Biener , gcc-patches List , David Malcolm Subject: [PATCH 02/11] cp_tree::maybe_add_location_wrapper: no-op for template decls Date: Fri, 17 Nov 2017 21:52:34 -0500 Message-Id: <1510973563-10046-3-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1510973563-10046-1-git-send-email-dmalcolm@redhat.com> References: <1510350329-48956-1-git-send-email-dmalcolm@redhat.com> <1510973563-10046-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes For simplicity, add a gate on !processing_template_decl to cp_tree::maybe_add_location_wrapper. gcc/cp/ChangeLog: * cp-tree.h (cp_expr::maybe_add_location_wrapper): Do nothing if processing_template_decl. --- gcc/cp/cp-tree.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 03087f0..63e9bff 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -93,11 +93,7 @@ public: set_location (make_location (m_loc, start, finish)); } - cp_expr& maybe_add_location_wrapper () - { - m_value = maybe_wrap_with_location (m_value, m_loc); - return *this; - } + cp_expr& maybe_add_location_wrapper (); private: tree m_value; @@ -1642,6 +1638,16 @@ struct warning_sentinel ~warning_sentinel() { flag = val; } }; +inline cp_expr& +cp_expr::maybe_add_location_wrapper () +{ + /* For now, don't add wrappers when processing template decls. */ + if (!processing_template_decl) + m_value = maybe_wrap_with_location (m_value, m_loc); + return *this; +} + + /* The cached class binding level, from the most recently exited class, or NULL if none. */