aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constexpr.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2021-09-15 19:01:14 -0400
committerJason Merrill <jason@redhat.com>2021-09-15 23:42:59 -0400
commit8d970817a5892b6bb4634499d47f6d2ee7d46e4c (patch)
treee2307efba65502af285e1447e2fb98b40a1a334a /gcc/cp/constexpr.c
parente0c09143c96b97499d12dd0227a45eb8fb6a3d91 (diff)
downloadgcc-8d970817a5892b6bb4634499d47f6d2ee7d46e4c.zip
gcc-8d970817a5892b6bb4634499d47f6d2ee7d46e4c.tar.gz
gcc-8d970817a5892b6bb4634499d47f6d2ee7d46e4c.tar.bz2
c++: Small location tweak
As Marek suggested. gcc/cp/ChangeLog: * constexpr.c (cxx_eval_outermost_constant_expr): Use protected_set_expr_location.
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r--gcc/cp/constexpr.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index d3c075c..8a5dd06 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;
}