[Bug c++/101759] #pragma omp declare simd/variant or oacc routine parsing bug

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Aug 4 09:56:08 GMT 2021


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

--- 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:af31cab04770f7a1a1da069415ab62ca2ef54fc4

commit r12-2726-gaf31cab04770f7a1a1da069415ab62ca2ef54fc4
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Aug 4 11:53:48 2021 +0200

    c++: Fix up #pragma omp declare {simd,variant} and acc routine parsing

    When parsing default arguments, we need to temporarily clear
parser->omp_declare_simd
    and parser->oacc_routine, otherwise it can clash with further declarations
    inside of e.g. lambdas inside of those default arguments.

    2021-08-04  Jakub Jelinek  <jakub@redhat.com>

            PR c++/101759
            * parser.c (cp_parser_default_argument): Temporarily override
            parser->omp_declare_simd and parser->oacc_routine to NULL.

            * g++.dg/gomp/pr101759.C: New test.
            * g++.dg/goacc/pr101759.C: New test.


More information about the Gcc-bugs mailing list