]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp: Handle OpenMP directives in attribute syntax in attribute-declaration
authorJakub Jelinek <jakub@redhat.com>
Sat, 31 Jul 2021 07:35:25 +0000 (09:35 +0200)
committerJakub Jelinek <jakub@redhat.com>
Sat, 31 Jul 2021 07:35:25 +0000 (09:35 +0200)
commit05bcef5a88b34dd13179cabbe902e9135cb40ffe
treea89441dc67c96a6c5a881c6fe2615a666f1963ce
parent91425e2adecd00091d7443104ecb367686e88663
openmp: Handle OpenMP directives in attribute syntax in attribute-declaration

Now that we parse attribute-declaration (outside of functions), the following
patch handles OpenMP directives in its attribute(s).
What needs handling incrementally is diagnose mismatching begin/end pair
like
 [[omp::directive (declare target)]];
 int a;
 #pragma omp end declare target
or
 #pragma omp declare target
 int b;
 [[omp::directive (end declare target)]];
and handling declare simd/declare variant on declarations (function
definitions and declarations), for those in two different spots.

2021-07-31  Jakub Jelinek  <jakub@redhat.com>

* parser.c (cp_parser_declaration): Handle OpenMP directives
in attribute-declaration.

* g++.dg/gomp/attrs-9.C: New test.
gcc/cp/parser.c
gcc/testsuite/g++.dg/gomp/attrs-9.C [new file with mode: 0644]