diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-08-12 09:18:23 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2021-08-12 09:34:16 +0200 |
commit | ef07b918a7ad4f64e0e1e3db21d861f2e79de92a (patch) | |
tree | 1215789c5a20c7c4ed3826a1d8801190ea429d94 /gcc/cp/decl2.c | |
parent | 9b7ab853bf33106fd0539e36d6ce7730269026e1 (diff) | |
download | gcc-ef07b918a7ad4f64e0e1e3db21d861f2e79de92a.zip gcc-ef07b918a7ad4f64e0e1e3db21d861f2e79de92a.tar.gz gcc-ef07b918a7ad4f64e0e1e3db21d861f2e79de92a.tar.bz2 |
openmp: Diagnose another case of mixing parameter and attribute syntax
This patch diagnoses cases like:
#pragma omp parallel
[[omp::directive (declare simd)]] int foo ();
or
#pragma omp taskgroup
int bar [[omp::directive (declare simd)]] (int);
where the pragma is on the same declaration statement as the declare simd
attribute.
2021-08-12 Jakub Jelinek <jakub@redhat.com>
* parser.c (cp_parser_lambda_body): Add temp overrides
for parser->{omp_declare_simd,oacc_routine,omp_attrs_forbidden_p}.
(cp_parser_statement): Restore parser->omp_attrs_forbidden_p for
cp_parser_declaration_statement.
(cp_parser_default_argument): Add temp override for
parser->omp_attrs_forbidden_p.
(cp_parser_late_parsing_omp_declare_simd): Diagnose declare simd
or declare variant in attribute syntax on a declaration immediately
following an OpenMP construct in pragma syntax.
* g++.dg/gomp/attrs-11.C: Add new tests.
Diffstat (limited to 'gcc/cp/decl2.c')
0 files changed, 0 insertions, 0 deletions