c++: Fix ENABLE_SCOPE_CHECKING printing
commitfe1649eea76f193732d22ec022a35326523eb37a
authorNathaniel Shead <nathanieloshead@gmail.com>
Tue, 16 Jan 2024 09:56:46 +0000 (16 20:56 +1100)
committerNathaniel Shead <nathanieloshead@gmail.com>
Tue, 16 Jan 2024 22:40:42 +0000 (17 09:40 +1100)
tree739eaebd7ad3655f3bbdffc647634d22db75ad2a
parent7d397269753ca70256ce309b4d3081154e8c7a65
c++: Fix ENABLE_SCOPE_CHECKING printing

The lists of scope kinds used by ENABLE_SCOPE_CHECKING don't seem to
have been updated in a long while, causing ICEs and confusing output.
This patch brings the list into line.

Additionally, the comment on 'explicit_spec_p' says that the flag is
only valid if kind is 'sk_template_parms', so we rewrite the condition
to be more obviously correct here.

gcc/cp/ChangeLog:

* name-lookup.h (enum scope_kind): Add 'sk_count'.
* name-lookup.cc (cp_binding_level_descriptor): Add missing
scope kinds. Add assertion that the list is up to date. Fix
handling of explicit_spec_p.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/name-lookup.cc
gcc/cp/name-lookup.h