c++: missing state restoration in maybe_pop_from_top_level
commit7f26997e6479920c8c6f40894f7d02931f983f82
authorPatrick Palka <ppalka@redhat.com>
Tue, 19 Dec 2023 21:26:27 +0000 (19 16:26 -0500)
committerPatrick Palka <ppalka@redhat.com>
Tue, 19 Dec 2023 21:26:27 +0000 (19 16:26 -0500)
tree94d220938e555366edea61c019bc8fe9a5144df2
parent5ba949c096f5250aa4efb94fb7c94d1304c1bf39
c++: missing state restoration in maybe_pop_from_top_level

In the function-local case of maybe_pop_from_top_level, we need to
restore the global flags that maybe_push_to_top_level cleared.

gcc/cp/ChangeLog:

* name-lookup.cc (struct local_state_t): Define.
(local_state_stack): Define.
(maybe_push_to_top_level): Use them.
(maybe_pop_from_top_level): Likewise.
* pt.cc (instantiate_decl): Remove dead code for saving/restoring
cp_unevaluated_operand and c_inhibit_evaluation_warnings.
gcc/cp/name-lookup.cc
gcc/cp/pt.cc