aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Compiler.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-07-04 16:10:12 +0200
committerGitHub <noreply@github.com>2025-07-04 16:10:12 +0200
commit258c048f643fff59be15f43f126629a356ef60fa (patch)
tree7c77bb44e222865881d9e486dab8738fa7bf4dbe /clang/lib/AST/ByteCode/Compiler.cpp
parent45909ec469cea4bc479d5c7d0731dec8e8e91112 (diff)
downloadllvm-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.cpp2
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))