diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-07-04 16:10:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-04 16:10:12 +0200 |
commit | 258c048f643fff59be15f43f126629a356ef60fa (patch) | |
tree | 7c77bb44e222865881d9e486dab8738fa7bf4dbe /clang/lib/AST/ByteCode/Compiler.cpp | |
parent | 45909ec469cea4bc479d5c7d0731dec8e8e91112 (diff) | |
download | llvm-258c048f643fff59be15f43f126629a356ef60fa.zip llvm-258c048f643fff59be15f43f126629a356ef60fa.tar.gz llvm-258c048f643fff59be15f43f126629a356ef60fa.tar.bz2 |
[clang][bytecode] Fix copy constructors for empty unions (#147050)
Nothing to do in that case.
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/Compiler.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index 20580c8..5ed65f2 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -5836,6 +5836,8 @@ bool Compiler<Emitter>::compileConstructor(const CXXConstructorDecl *Ctor) { return false; if (R->isUnion() && Ctor->isCopyOrMoveConstructor()) { + if (R->getNumFields() == 0) + return this->emitRetVoid(Ctor); // union copy and move ctors are special. assert(cast<CompoundStmt>(Ctor->getBody())->body_empty()); if (!this->emitThis(Ctor)) |