r319897 - [OPENMP] Improve error message for mapping union members.

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 6 07:04:37 PST 2017


Author: abataev
Date: Wed Dec  6 07:04:36 2017
New Revision: 319897

URL: http://llvm.org/viewvc/llvm-project?rev=319897&view=rev
Log:
[OPENMP] Improve error message for mapping union members.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/test/OpenMP/target_map_messages.cpp
    cfe/trunk/test/OpenMP/target_teams_map_messages.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=319897&r1=319896&r2=319897&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Dec  6 07:04:36 2017
@@ -8617,7 +8617,7 @@ def err_omp_bit_fields_forbidden_in_clau
 def err_array_section_does_not_specify_contiguous_storage : Error<
   "array section does not specify contiguous storage">;
 def err_omp_union_type_not_allowed : Error<
-  "mapped storage cannot be derived from a union">;
+  "mapping of union members is not allowed">;
 def err_omp_expected_access_to_data_field : Error<
   "expected access to data field">;
 def err_omp_multiple_array_items_in_map_clause : Error<

Modified: cfe/trunk/test/OpenMP/target_map_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_map_messages.cpp?rev=319897&r1=319896&r2=319897&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_map_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_map_messages.cpp Wed Dec  6 07:04:36 2017
@@ -274,7 +274,7 @@ void SAclient(int arg) {
   {}
   #pragma omp target map((p+1)->A)  // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}}
   {}
-  #pragma omp target map(u.B)  // expected-error {{mapped storage cannot be derived from a union}}
+  #pragma omp target map(u.B)  // expected-error {{mapping of union members is not allowed}}
   {}
   #pragma omp target
   {

Modified: cfe/trunk/test/OpenMP/target_teams_map_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_teams_map_messages.cpp?rev=319897&r1=319896&r2=319897&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/target_teams_map_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/target_teams_map_messages.cpp Wed Dec  6 07:04:36 2017
@@ -265,7 +265,7 @@ void SAclient(int arg) {
   {}
   #pragma omp target teams map((p+1)->A)  // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}}
   {}
-  #pragma omp target teams map(u.B)  // expected-error {{mapped storage cannot be derived from a union}}
+  #pragma omp target teams map(u.B)  // expected-error {{mapping of union members is not allowed}}
   {}
 
   #pragma omp target data map(to: r.C) //expected-note {{used here}}




More information about the cfe-commits mailing list