You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[flang][OpenMP] Fix scope checks for ALLOCATE directive (llvm#160948)
Make sure that the ALLOCATE directive adds its source span to the
current scope, and that the scope checks compare scoping units, not the
specific scopes.
"List items specified in the ALLOCATE directive must not have the ALLOCATABLE attribute unless the directive is associated with an ALLOCATE statement"_err_en_US);
3025
3017
}
3026
-
if ((ompFlag == Symbol::Flag::OmpDeclarativeAllocateDirective ||
!ERROR: List items must be declared in the same scoping unit in which the ALLOCATE directive appears
34
36
!$omp allocate(z)
35
37
36
38
!$omp allocate(w) allocator(custom_allocator)
@@ -40,5 +42,6 @@ subroutine allocate()
40
42
!ERROR: If list items within the ALLOCATE directive have the SAVE attribute, are a common block name, or are declared in the scope of a module, then only predefined memory allocator parameters can be used in the allocator clause
41
43
!$omp allocate(y) allocator(custom_allocator)
42
44
!ERROR: If list items within the ALLOCATE directive have the SAVE attribute, are a common block name, or are declared in the scope of a module, then only predefined memory allocator parameters can be used in the allocator clause
45
+
!ERROR: List items must be declared in the same scoping unit in which the ALLOCATE directive appears
!ERROR: List items must be declared in the same scoping unit in which the ALLOCATORS directive appears
25
26
!$omp allocators allocate(omp_default_mem_alloc: a)
26
27
allocate(a)
27
28
28
29
!ERROR: If list items within the ALLOCATORS directive have the SAVE attribute, are a common block name, or are declared in the scope of a module, then only predefined memory allocator parameters can be used in the allocator clause
30
+
!ERROR: List items must be declared in the same scoping unit in which the ALLOCATORS directive appears
0 commit comments