diff options
author | Martin Liska <mliska@suse.cz> | 2021-11-22 17:39:30 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2021-11-22 17:39:30 +0100 |
commit | 44a06feaf84111c298bb906b4906b54073fc61d5 (patch) | |
tree | 93211de0a07d41e0e046e7b37db2e99578a661a9 /gcc/cp/parser.c | |
parent | ffa33d36af92357098870be1e7dbedad0f883a37 (diff) | |
parent | c38c547a708d9f144ba36f54d3d6ab5f5995966f (diff) | |
download | gcc-44a06feaf84111c298bb906b4906b54073fc61d5.zip gcc-44a06feaf84111c298bb906b4906b54073fc61d5.tar.gz gcc-44a06feaf84111c298bb906b4906b54073fc61d5.tar.bz2 |
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index aa7f0e4..e2b5d68 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -46852,8 +46852,8 @@ cp_parser_late_parsing_oacc_routine (cp_parser *parser, tree attrs) emission easier. */ parser->oacc_routine->clauses = nreverse (parser->oacc_routine->clauses); cp_parser_pop_lexer (parser); - /* Later, cp_finalize_oacc_routine will process the clauses, and then set - fndecl_seen. */ + /* Later, cp_finalize_oacc_routine will process the clauses. */ + parser->oacc_routine->fndecl_seen = true; return attrs; } @@ -46871,16 +46871,17 @@ cp_finalize_oacc_routine (cp_parser *parser, tree fndecl, bool is_defn) || fndecl == error_mark_node) return; - if (parser->oacc_routine->fndecl_seen) - { - error_at (parser->oacc_routine->loc, - "%<#pragma acc routine%> not immediately followed by" - " a single function declaration or definition"); - parser->oacc_routine = NULL; - return; - } if (TREE_CODE (fndecl) != FUNCTION_DECL) { + if (parser->oacc_routine->fndecl_seen) + { + error_at (parser->oacc_routine->loc, + "%<#pragma acc routine%> not immediately followed by" + " a single function declaration or definition"); + parser->oacc_routine = NULL; + return; + } + cp_ensure_no_oacc_routine (parser); return; } @@ -46921,11 +46922,6 @@ cp_finalize_oacc_routine (cp_parser *parser, tree fndecl, bool is_defn) parser->oacc_routine->clauses, DECL_ATTRIBUTES (fndecl)); } - - /* Don't unset parser->oacc_routine here: we may still need it to - diagnose wrong usage. But, remember that we've used this "#pragma acc - routine". */ - parser->oacc_routine->fndecl_seen = true; } } |