8sa1-gcc/gcc/c
Jakub Jelinek 2dc9294c3c openmp: Reject requires directives not at file or namespace scope [PR94593]
This change started with a bugreport about a typo in one requires testcase
(diagnosed with -Wunknown-pragmas only), but following discussion lead to
noting that we do not diagnose restriction that requires directives in
C/C++ may only appear at file or namespace scope; and several our tests
violated that.

2020-04-15  Jakub Jelinek  <jakub@redhat.com>

	PR c/94593
	* c-parser.c (c_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
	requires directive when not at file scope.

	* parser.c (cp_parser_pragma) <case PRAGMA_OMP_REQUIRES>: Reject
	requires directive when not at file or namespace scope.

	* c-c++-common/gomp/requires-1.c: Fix a typo, requries -> requires.
	Move directives to file scope.
	(i): Remove.
	* c-c++-common/gomp/requires-2.c: Move directives to file scope.
	(i, foo): Remove.
	* c-c++-common/gomp/requires-4.c: Move directives to file scope.
	* c-c++-common/gomp/atomic-19.c: Move requires directive to file scope.
	* c-c++-common/gomp/atomic-20.c: Likewise.
	* c-c++-common/gomp/atomic-21.c: Likewise.
	* c-c++-common/gomp/atomic-22.c: Likewise.
	* gcc.dg/gomp/requires-1.c: New test.
	* g++.dg/gomp/requires-1.C: New test.
	* g++.dg/gomp/requires-2.C: New test.
	* g++.dg/gomp/atomic-18.C: Move requires directive to file scope.
2020-04-15 09:59:14 +02:00
..
c-aux-info.c Update copyright years. 2020-01-01 12:51:42 +01:00
c-convert.c Update copyright years. 2020-01-01 12:51:42 +01:00
c-decl.c [C/C++, OpenACC] Reject vars of different scope in acc declare (PR94120) 2020-04-08 09:39:43 +02:00
c-errors.c Update copyright years. 2020-01-01 12:51:42 +01:00
c-fold.c c: Handle MEM_REF in c_fully_fold* [PR94179] 2020-03-16 22:58:41 +01:00
c-lang.c Update copyright years. 2020-01-01 12:51:42 +01:00
c-lang.h Update copyright years. 2020-01-01 12:51:42 +01:00
c-objc-common.c Update copyright years. 2020-01-01 12:51:42 +01:00
c-objc-common.h Update copyright years. 2020-01-01 12:51:42 +01:00
c-parser.c openmp: Reject requires directives not at file or namespace scope [PR94593] 2020-04-15 09:59:14 +02:00
c-parser.h Update copyright years. 2020-01-01 12:51:42 +01:00
c-tree.h [C/C++, OpenACC] Reject vars of different scope in acc declare (PR94120) 2020-04-08 09:39:43 +02:00
c-typeck.c c: Handle C_TYPE_INCOMPLETE_VARS even for ENUMERAL_TYPEs [PR94172] 2020-03-17 22:32:34 +01:00
ChangeLog openmp: Reject requires directives not at file or namespace scope [PR94593] 2020-04-15 09:59:14 +02:00
config-lang.in Update copyright years. 2020-01-01 12:51:42 +01:00
gccspec.c Update copyright years. 2020-01-01 12:51:42 +01:00
gimple-parser.c typo fix: Fix probablity, becuse, sucessor and destinarion typos [PR93912] 2020-02-25 22:10:48 +01:00
gimple-parser.h Update copyright years. 2020-01-01 12:51:42 +01:00
Make-lang.in Update copyright years. 2020-01-01 12:51:42 +01:00