c++: Preserve location in maybe_constant_value.
authorJason Merrill <jason@redhat.com>
Fri, 7 Feb 2020 21:28:20 +0000 (16:28 -0500)
committerJason Merrill <jason@redhat.com>
Sat, 8 Feb 2020 16:14:58 +0000 (11:14 -0500)
commit173c8defa6e82f1bc003173b6ee1e4eb2830d1c2
tree8224edef4128d22964c207c4dcae64f6f37cf46e
parent61f5369f7ecf1eff9cd7a7016324d60eec338806
c++: Preserve location in maybe_constant_value.

If cxx_eval_outermost_constant_expr doesn't change the argument, we really
shouldn't unshare it when we try to fold it again.

PR c++/92852
* constexpr.c (maybe_constant_value): Don't unshare if the cached
value is the same as the argument.
gcc/cp/ChangeLog
gcc/cp/constexpr.c