c++: make some cp_trait_kind switch statements exhaustive
commitc051060ade8a4392bbd4604a551a8dcb8c937f45
authorPatrick Palka <ppalka@redhat.com>
Sat, 1 Oct 2022 16:21:36 +0000 (1 12:21 -0400)
committerPatrick Palka <ppalka@redhat.com>
Sat, 1 Oct 2022 16:21:36 +0000 (1 12:21 -0400)
treeb940822e9556940ad865cbd828bc6ee07c127570
parentca01d2526917ec6e54b30472d3aedfd46d4ca585
c++: make some cp_trait_kind switch statements exhaustive

This replaces the unreachable default case in some cp_trait_kind
switches with an exhaustive listing of the trait codes that we don't
expect to see, so that when adding a new trait we'll get a helpful
-Wswitch warning if we forget to handle the new trait in a relevant
switch.

gcc/cp/ChangeLog:

* semantics.cc (trait_expr_value): Make cp_trait_kind switch
statement exhaustive.
(finish_trait_expr): Likewise.
(finish_trait_type): Likewise.
gcc/cp/semantics.cc