================
@@ -19238,8 +18369,13 @@ OMPClause *SemaOpenMP::ActOnOpenMPMessageClause(Expr 
*ME,
                                                 SourceLocation EndLoc) {
   assert(ME && "NULL expr in Message clause");
   QualType Type = ME->getType();
-  if ((!Type->isPointerType() && !Type->isArrayType()) ||
-      !Type->getPointeeOrArrayElementType()->isAnyCharacterType()) {
+  // The message is consumed as a narrow string by Sema and the runtime.
+  bool IsNarrowString = false;
+  if (Type->isPointerType() || Type->isArrayType()) {
+    const auto *ElemTy = Type->getPointeeOrArrayElementType();
+    IsNarrowString = ElemTy->isCharType() || ElemTy->isChar8Type();
----------------
akash-manna-sky wrote:

The spec defines `msg-string` as a string of `const char *` type (OpenMP 5.1 
ยง2.5.4), and the runtime entry points `__kmpc_error` and 
`__kmpc_push_num_threads_strict` take `const char *` as well, so a wide string 
can't be passed through for `at(execution)`. GCC rejects it too.


https://github.com/llvm/llvm-project/pull/226080
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to