https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111392
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:04b2fb5bb644f172879a02e8374ad50b669e3d6d commit r14-4167-g04b2fb5bb644f172879a02e8374ad50b669e3d6d Author: Jakub Jelinek <ja...@redhat.com> Date: Wed Sep 20 08:43:02 2023 +0200 openmp: Add omp::decl attribute support [PR111392] This patch adds support for (so far C++) omp::decl attribute. For declare simd and declare variant directives it is essentially another spelling of omp::decl, except per discussions it is not allowed inside of omp::sequence attribute. For threadprivate, declare target, allocate and later groupprivate directives it should appertain to variable (or for declare target also function definitions and) declarations and where in normal syntax one specifies a list of variables (or variables and functions), either as argument of the directive or clause argument, such argument is not specified and implied to be the variable it applies to. 2023-09-20 Jakub Jelinek <ja...@redhat.com> PR c++/111392 gcc/ * attribs.cc (decl_attributes): Don't warn on omp::directive attribute on vars or function decls if -fopenmp or -fopenmp-simd. gcc/c-family/ * c-omp.cc (c_omp_directives): Add commented out groupprivate directive entry. gcc/cp/ * parser.h (struct cp_lexer): Add in_omp_decl_attribute member. * cp-tree.h (cp_maybe_parse_omp_decl): Declare. * parser.cc (cp_parser_handle_statement_omp_attributes): Diagnose omp::decl attribute on statements. Adjust diagnostic wording for omp::decl. (cp_parser_omp_directive_args): Add DECL_P argument, set TREE_PUBLIC to it on the DEFERRED_PARSE tree. (cp_parser_omp_sequence_args): Adjust caller. (cp_parser_std_attribute): Handle omp::decl attribute. (cp_parser_omp_var_list): If parser->lexer->in_omp_decl_attribute don't expect any arguments, instead create clause or TREE_LIST for that decl. (cp_parser_late_parsing_omp_declare_simd): Adjust diagnostic wording for omp::decl. (cp_maybe_parse_omp_decl): New function. (cp_parser_omp_declare_target): If parser->lexer->in_omp_decl_attribute and first token isn't name or comma invoke cp_parser_omp_var_list. * decl2.cc (cplus_decl_attributes): Adjust diagnostic wording for omp::decl. Handle omp::decl on declarations. * name-lookup.cc (finish_using_directive): Adjust diagnostic wording for omp::decl. gcc/testsuite/ * g++.dg/gomp/attrs-19.C: New test. * g++.dg/gomp/attrs-20.C: New test. * g++.dg/gomp/attrs-21.C: New test. libgomp/ * libgomp.texi: Mark decl attribute was added to the C++ attribute syntax as implemented.