[PATCH] D71134: [OpenMP] Require trivially copyable type for mapping

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 6 12:06:35 PST 2019


Hahnfeld marked 2 inline comments as done.
Hahnfeld added inline comments.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:14917
   if (FullCheck && !SemaRef.CurContext->isDependentContext() &&
-      !QTy.isTrivialType(SemaRef.Context))
+      !QTy.isTriviallyCopyableType(SemaRef.Context))
     SemaRef.Diag(SL, diag::warn_omp_non_trivial_type_mapped) << QTy << SR;
----------------
ABataev wrote:
> Need to add a check for defaulted destructor here, `isTriviallyCopyableType` does not include this check.
As I said in the summary, this is a prerequisite for being trivially copyable and as such checked by `CXXRecordDecl::isTriviallyCopyable()` (line `if (!hasTrivialDestructor()) return false;`).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71134/new/

https://reviews.llvm.org/D71134





More information about the cfe-commits mailing list