Commit 7cec9588 by Jakub Jelinek Committed by Jakub Jelinek

c-parser.c (c_parser_translation_unit): Diagnose declare target without…

c-parser.c (c_parser_translation_unit): Diagnose declare target without corresponding end declare target.

	* c-parser.c (c_parser_translation_unit): Diagnose declare target
	without corresponding end declare target.

	* semantics.c (finish_translation_unit): Diagnose declare target
	without corresponding end declare target.

	* c-c++-common/gomp/declare-target-5.c: New test.

From-SVN: r278065
parent 599bd990
2019-11-11 Jakub Jelinek <jakub@redhat.com>
* c-parser.c (c_parser_translation_unit): Diagnose declare target
without corresponding end declare target.
2019-11-08 Richard Sandiford <richard.sandiford@arm.com>
* c-convert.c (convert): Only handle vector conversions if one of
......
......@@ -1554,6 +1554,14 @@ c_parser_translation_unit (c_parser *parser)
FOR_EACH_VEC_ELT (incomplete_record_decls, i, decl)
if (DECL_SIZE (decl) == NULL_TREE && TREE_TYPE (decl) != error_mark_node)
error ("storage size of %q+D isn%'t known", decl);
if (current_omp_declare_target_attribute)
{
if (!errorcount)
error ("%<#pragma omp declare target%> without corresponding "
"%<#pragma omp end declare target%>");
current_omp_declare_target_attribute = 0;
}
}
/* Parse an external declaration (C90 6.7, C99 6.9, C11 6.9).
......
2019-11-11 Jakub Jelinek <jakub@redhat.com>
* semantics.c (finish_translation_unit): Diagnose declare target
without corresponding end declare target.
2019-11-10 Jason Merrill <jason@redhat.com>
Implement D1957R0, T* to bool should be considered narrowing.
......
......@@ -3048,6 +3048,14 @@ finish_translation_unit (void)
/* Do file scope __FUNCTION__ et al. */
finish_fname_decls ();
if (scope_chain->omp_declare_target_attribute)
{
if (!errorcount)
error ("%<#pragma omp declare target%> without corresponding "
"%<#pragma omp end declare target%>");
scope_chain->omp_declare_target_attribute = 0;
}
}
/* Finish a template type parameter, specified as AGGR IDENTIFIER.
......
2019-11-11 Jakub Jelinek <jakub@redhat.com>
* c-c++-common/gomp/declare-target-5.c: New test.
2019-11-11 Richard Sandiford <richard.sandiford@arm.com>
* gcc.dg/vect/pr92420.c: New test.
......
#pragma omp declare target
void foo (void); /* { dg-error "'#pragma omp declare target' without corresponding '#pragma omp end declare target'" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment