[Bug c++/106448] [OpenMP] atomic compare – g++ wrongly accepts parenthesized condition

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 29 08:00:54 GMT 2022


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

--- Comment #5 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:2dcceedb3c121f2498ae58d8414e7b8454b7bf55

commit r13-1888-g2dcceedb3c121f2498ae58d8414e7b8454b7bf55
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Jul 29 09:59:19 2022 +0200

    openmp: Reject invalid forms of C++ #pragma omp atomic compare [PR106448]

    The allowed syntaxes of atomic compare don't allow ()s around the condition
    of ?:, but we were accepting it in one case for C++.

    Fixed thusly.

    2022-07-29  Jakub Jelinek  <jakub@redhat.com>

            PR c++/106448
            * parser.cc (cp_parser_omp_atomic): For simple cast followed by
            CPP_QUERY token, don't try cp_parser_binary_operation if compare
            is true.

            * c-c++-common/gomp/atomic-32.c: New test.


More information about the Gcc-bugs mailing list