From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id 98DE93858005; Thu, 16 Sep 2021 03:48:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98DE93858005 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jason Merrill To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-3562] c++: Small location tweak X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/master X-Git-Oldrev: e0c09143c96b97499d12dd0227a45eb8fb6a3d91 X-Git-Newrev: 8d970817a5892b6bb4634499d47f6d2ee7d46e4c Message-Id: <20210916034836.98DE93858005@sourceware.org> Date: Thu, 16 Sep 2021 03:48:36 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 03:48:36 -0000 https://gcc.gnu.org/g:8d970817a5892b6bb4634499d47f6d2ee7d46e4c commit r12-3562-g8d970817a5892b6bb4634499d47f6d2ee7d46e4c Author: Jason Merrill Date: Wed Sep 15 19:01:14 2021 -0400 c++: Small location tweak As Marek suggested. gcc/cp/ChangeLog: * constexpr.c (cxx_eval_outermost_constant_expr): Use protected_set_expr_location. Diff: --- gcc/cp/constexpr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index d3c075c5ab8..8a5dd067bcb 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -7502,8 +7502,7 @@ cxx_eval_outermost_constant_expr (tree t, bool allow_non_constant, /* Remember the original location if that wouldn't need a wrapper. */ if (location_t loc = EXPR_LOCATION (t)) - if (CAN_HAVE_LOCATION_P (r)) - SET_EXPR_LOCATION (r, loc); + protected_set_expr_location (r, loc); return r; }