aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2023-12-08 15:55:49 -0500
committerJason Merrill <jason@redhat.com>2023-12-10 13:11:22 -0500
commite410303f768fa7b020e46f3bd7d28381144e5340 (patch)
tree495d64cfad7911068e764ce4530ab4ac460fe705
parentdf3559d951ba6572e254a1bd1ef9a34b6e543325 (diff)
downloadgcc-e410303f768fa7b020e46f3bd7d28381144e5340.zip
gcc-e410303f768fa7b020e46f3bd7d28381144e5340.tar.gz
gcc-e410303f768fa7b020e46f3bd7d28381144e5340.tar.bz2
c++: trait patch tweak
As Patrick suggested elsewhere, let's move this into the default case. gcc/cp/ChangeLog: * parser.cc (cp_parser_simple_type_specifier): Move trait handling to default label.
-rw-r--r--gcc/cp/parser.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 9e76426..b987324 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -20164,20 +20164,20 @@ cp_parser_simple_type_specifier (cp_parser* parser,
return type;
default:
- break;
- }
+ /* If token is a type-yielding built-in traits, parse it. */
+ const cp_trait* trait = cp_lexer_peek_trait_type (parser->lexer);
+ if (trait)
+ {
+ type = cp_parser_trait (parser, trait);
+ if (decl_specs)
+ cp_parser_set_decl_spec_type (decl_specs, type,
+ token,
+ /*type_definition_p=*/false);
- /* If token is a type-yielding built-in traits, parse it. */
- const cp_trait* trait = cp_lexer_peek_trait_type (parser->lexer);
- if (trait)
- {
- type = cp_parser_trait (parser, trait);
- if (decl_specs)
- cp_parser_set_decl_spec_type (decl_specs, type,
- token,
- /*type_definition_p=*/false);
+ return type;
+ }
- return type;
+ break;
}
/* If token is an already-parsed decltype not followed by ::,