summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-04-29 19:26:57 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-04-29 19:26:57 +0000
commit419bd0941514bad6fa9d66e6f76360791389e7e0 (patch)
treeeac43af91c8b6458ab4dc6478c239e12534894fd /clang/lib/Sema
parentae7e4995ca2c506200f7673d9161df2d851582fb (diff)
downloadbcm5719-llvm-419bd0941514bad6fa9d66e6f76360791389e7e0.tar.gz
bcm5719-llvm-419bd0941514bad6fa9d66e6f76360791389e7e0.zip
PR23373: A defaulted union copy constructor that is not trivial must still be
emitted as a memcpy. llvm-svn: 236142
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index b06b509de1e..8599a0213d2 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -10214,7 +10214,9 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation,
// Assign non-static members.
for (auto *Field : ClassDecl->fields()) {
- if (Field->isUnnamedBitfield())
+ // FIXME: We should form some kind of AST representation for the implied
+ // memcpy in a union copy operation.
+ if (Field->isUnnamedBitfield() || Field->getParent()->isUnion())
continue;
if (Field->isInvalidDecl()) {
@@ -10644,7 +10646,9 @@ void Sema::DefineImplicitMoveAssignment(SourceLocation CurrentLocation,
// Assign non-static members.
for (auto *Field : ClassDecl->fields()) {
- if (Field->isUnnamedBitfield())
+ // FIXME: We should form some kind of AST representation for the implied
+ // memcpy in a union copy operation.
+ if (Field->isUnnamedBitfield() || Field->getParent()->isUnion())
continue;
if (Field->isInvalidDecl()) {
OpenPOWER on IntegriCloud