[clang] [OpenMP] Allow OMP6.0 features. (PR #122108)

Michael Kruse via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 27 05:56:13 PST 2025


================
@@ -68,15 +70,21 @@ int fun(int arg) {
       {}
 #pragma omp target map(mapper(aa :vv)                                   // expected-error {{use of undeclared identifier 'aa'}} expected-error {{expected ')'}} expected-error {{call to undeclared function 'mapper'}} expected-note {{to match this '('}}
       {}
+#ifndef OMP60
 #pragma omp target map(mapper(ab) :vv)                                  // expected-error {{missing map type}} expected-error {{cannot find a valid user-defined mapper for type 'struct vec' with name 'ab'}}
+#endif
       {}
+#ifndef OMP60
 #pragma omp target map(mapper(ab) :arr[0:2])                            // expected-error {{missing map type}} expected-error {{cannot find a valid user-defined mapper for type 'struct vec' with name 'ab'}}
+#endif
       {}
-#pragma omp target map(mapper(aa) :vv)                                  // expected-error {{missing map type}}
+#ifndef OMP60
+#pragma omp target map(mapper(aa) :vv)                                  // omp50-error {{missing map type}} omp51-error {{missing map type}} omp52-error {{missing map type}} omp51-simd-error {{missing map type}}
       {}
-#pragma omp target map(mapper(aa) to:d)                                 // expected-error {{mapper type must be of struct, union or class type}} omp52-error{{missing ',' after map type modifier}}
+#endif
+#pragma omp target map(mapper(aa) to:d)                                 // expected-error {{mapper type must be of struct, union or class type}} omp52-error{{missing ',' after map type modifier}} omp60-error{{missing ',' after map type modifier}} omp60-simd-error{{missing ',' after map type modifier}}
----------------
Meinersbur wrote:

```suggestion
// expected-error at +4 {{mapper type must be of struct, union or class type}} 
// omp52-error at +3 {{missing ',' after map type modifier}} 
// omp60-error at +2 {{missing ',' after map type modifier}} 
// omp60-simd-error at +1 {{missing ',' after map type modifier}}
#pragma omp target map(mapper(aa) to:d)                                
```

https://github.com/llvm/llvm-project/pull/122108


More information about the cfe-commits mailing list