diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-10-10 14:36:35 +0200 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2023-10-17 11:47:29 +0000 |
commit | 948523ad7e40af30a45ca0e20f6d5c7ff3e00f4f (patch) | |
tree | 9a4eb76107716c25d21f656ef518f5dd83691cc7 /gcc | |
parent | ba0fb415bf2faeedaf6f1888182385f5b502bd8c (diff) | |
download | gcc-948523ad7e40af30a45ca0e20f6d5c7ff3e00f4f.zip gcc-948523ad7e40af30a45ca0e20f6d5c7ff3e00f4f.tar.gz gcc-948523ad7e40af30a45ca0e20f6d5c7ff3e00f4f.tar.bz2 |
Allow call to macro named "default" at item level
The parser was too agressive and did reject any line beginning with
default even if this was a macro call.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_item): Relax constraints
around default identifier at item scope to accept "default" macros.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 8c2bf00..230ee38 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -1133,7 +1133,8 @@ Parser<ManagedTokenSource>::parse_item (bool called_from_statement) return parse_vis_item (std::move (outer_attrs)); // or should this go straight to parsing union? } - else if (t->get_str () == "default") + else if (t->get_str () == "default" + && lexer.peek_token (1)->get_id () != EXCLAM) { add_error (Error (t->get_locus (), "%qs is only allowed on items within %qs blocks", |