public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-3562] c++: Small location tweak
@ 2021-09-16  3:48 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2021-09-16  3:48 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8d970817a5892b6bb4634499d47f6d2ee7d46e4c

commit r12-3562-g8d970817a5892b6bb4634499d47f6d2ee7d46e4c
Author: Jason Merrill <jason@redhat.com>
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;
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-16  3:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16  3:48 [gcc r12-3562] c++: Small location tweak Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).