+2014-02-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/58703
+ * parser.c (cp_parser_omp_declare_reduction): Save and free
+ declarator_obstack.
+
2014-02-03 Marc Glisse <marc.glisse@inria.fr>
PR c++/53017
cp_token *first_token;
cp_token_cache *cp;
int errs;
+ void *p;
+
+ /* Get the high-water mark for the DECLARATOR_OBSTACK. */
+ p = obstack_alloc (&declarator_obstack, 0);
if (!cp_parser_require (parser, CPP_OPEN_PAREN, RT_OPEN_PAREN))
goto fail;
{
fail:
cp_parser_skip_to_pragma_eol (parser, pragma_tok);
- return;
+ goto done;
}
first_token = cp_lexer_peek_token (parser->lexer);
}
cp_parser_require_pragma_eol (parser, pragma_tok);
+
+ done:
+ /* Free any declarators allocated. */
+ obstack_free (&declarator_obstack, p);
}
/* OpenMP 4.0
--- /dev/null
+/* PR c++/58703 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+#pragma omp declare reduction (+ : char[] : omp_out += omp_in) /* { dg-error "function or array type" } */
+#pragma omp declare reduction (+ : char() : omp_out += omp_in) /* { dg-error "function or array type" } */