openmp: For C++ ensure nothing directive has no operands
authorJakub Jelinek <jakub@redhat.com>
Thu, 19 Aug 2021 08:35:39 +0000 (10:35 +0200)
committerJakub Jelinek <jakub@redhat.com>
Thu, 19 Aug 2021 08:35:39 +0000 (10:35 +0200)
commit4e6a5fa403782590088b2796261b023963f912af
treebc83d5b21497169269892394f49a4f0a9f5eed7e
parenteea1677fd03a1cb820cbb72044d4a0770f8a7a93
openmp: For C++ ensure nothing directive has no operands

When working on error directive, I've noticed that while C FE diagnosed
clauses on nothing directive which doesn't allow any, the C++ FE silently
accepted it.

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

* parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
instead of cp_parser_skip_to_pragma_eol.

* c-c++-common/gomp/nothing-2.c: New test.
gcc/cp/parser.c
gcc/testsuite/c-c++-common/gomp/nothing-2.c [new file with mode: 0644]