File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -2285,7 +2285,19 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Reduction &x) {
2285
2285
if (CheckReductionOperators (x)) {
2286
2286
CheckReductionTypeList (x);
2287
2287
}
2288
+
2289
+ SymbolSourceMap symbols;
2290
+ const auto &ompObjectList{std::get<parser::OmpObjectList>(x.v .t )};
2291
+ GetSymbolsInObjectList (ompObjectList, symbols);
2292
+ for (auto &[symbol, source] : symbols) {
2293
+ if (IsProcedurePointer (*symbol)) {
2294
+ context_.Say (source,
2295
+ " A procedure pointer '%s' must not appear in a REDUCTION clause." _err_en_US,
2296
+ symbol->name ());
2297
+ }
2298
+ }
2288
2299
}
2300
+
2289
2301
bool OmpStructureChecker::CheckReductionOperators (
2290
2302
const parser::OmpClause::Reduction &x) {
2291
2303
Original file line number Diff line number Diff line change
1
+ ! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
2
+
3
+ ! OpenMP 5.2: Section 5.5.5 : A procedure pointer must not appear in a
4
+ ! reduction clause.
5
+
6
+ procedure (foo), pointer :: ptr
7
+ integer :: i
8
+ ptr = > foo
9
+ ! ERROR: A procedure pointer 'ptr' must not appear in a REDUCTION clause.
10
+ ! $omp do reduction (+ : ptr)
11
+ do i = 1 , 10
12
+ end do
13
+ contains
14
+ subroutine foo
15
+ end subroutine
16
+ end
You can’t perform that action at this time.
0 commit comments