[Bug c++/102413] [12 Regression] ICE in cp_lexer_consume_token, at cp/parser.c:1172

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Sep 23 08:11:12 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102413

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:0d39eb28fd2ab00306bd7c0a87b6c0ed615b5d12

commit r12-3831-g0d39eb28fd2ab00306bd7c0a87b6c0ed615b5d12
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Sep 23 10:07:49 2021 +0200

    openmp: Diagnose omp::directive attribute without balanced token argument
[PR102413]

    If omp::directive attribute argument starting with the opening ( is not a
balanced
    token sequence, then cp_parser_skip_balanced_tokens (parser, 1) returns 1,
    but the code was subtracting 2 from it and iterating until it was 0, so for
the
    non-balanced case it iterated from (size_t) -1 down to 0.

    The following patch just diagnoses that as an error.

    2021-09-23  Jakub Jelinek  <jakub@redhat.com>

            PR c++/102413
            * parser.c (cp_parser_omp_directive_args): Diagnose if
omp::directive
            is not followed by a balanced token sequence starting with open
paren.

            * g++.dg/gomp/attrs-14.C: New test.


More information about the Gcc-bugs mailing list