aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 41b08e1..b46ee7c 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -36230,7 +36230,7 @@ cp_parser_oacc_declare (cp_parser *parser, cp_token *pragma_tok)
id = get_identifier ("omp declare target");
DECL_ATTRIBUTES (decl)
- = tree_cons (id, NULL_TREE, DECL_ATTRIBUTES (decl));
+ = tree_cons (id, NULL_TREE, DECL_ATTRIBUTES (decl));
if (global_bindings_p ())
{
symtab_node *node = symtab_node::get (decl);
@@ -36770,8 +36770,11 @@ cp_parser_omp_declare_target (cp_parser *parser, cp_token *pragma_tok)
}
if (!at1)
{
- symtab_node *node = symtab_node::get (t);
DECL_ATTRIBUTES (t) = tree_cons (id, NULL_TREE, DECL_ATTRIBUTES (t));
+ if (TREE_CODE (t) != FUNCTION_DECL && !is_global_var (t))
+ continue;
+
+ symtab_node *node = symtab_node::get (t);
if (node != NULL)
{
node->offloadable = 1;