diff options
Diffstat (limited to 'gcc/rust')
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index e636252..6d20f48 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -2261,6 +2261,16 @@ Parser<ManagedTokenSource>::parse_macro_match_repetition () case QUESTION_MARK: op = AST::MacroMatchRepetition::ZERO_OR_ONE; lexer.skip_token (); + + if (separator != nullptr) + { + add_error ( + Error (separator->get_locus (), + "the %<?%> macro repetition operator does not take a " + "separator")); + separator = nullptr; + } + break; default: add_error ( |