summaryrefslogtreecommitdiff
path: root/clang
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-07-31 22:12:34 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-07-31 22:12:34 +0000
commit899468a0006db4146d9b229234a183f499f7bcd2 (patch)
tree12efffe77267e4f6ff3b870da0e01dea0462993d /clang
parent2cedf089162d7ff08af2fb09e4adea44608e7233 (diff)
Notes
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 8bf605e5e76b8..533c5b1f6ff0b 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -2244,7 +2244,11 @@ OpenMPClauseKind Sema::isOpenMPPrivateDecl(ValueDecl *D, unsigned Level,
[](OpenMPDirectiveKind K) { return isOpenMPTaskingDirective(K); },
Level)) {
bool IsTriviallyCopyable =
- D->getType().getNonReferenceType().isTriviallyCopyableType(Context);
+ D->getType().getNonReferenceType().isTriviallyCopyableType(Context) &&
+ !D->getType()
+ .getNonReferenceType()
+ .getCanonicalType()
+ ->getAsCXXRecordDecl();
OpenMPDirectiveKind DKind = DSAStack->getDirective(Level);
SmallVector<OpenMPDirectiveKind, 4> CaptureRegions;
getOpenMPCaptureRegions(CaptureRegions, DKind);