Skip to content

Commit cbc3cbb

Browse files
committed
[Clang][NFC][ByteCode] Initialize Function HasBody in constructor
Static analysis flagged HasBody as not being initialized during construction. It looks like an oversight in: llvm#139671 This would be a lot simpler with C++20 which allows in class initialization of bit-fields.
1 parent 28b753b commit cbc3cbb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/AST/ByteCode/Function.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Function::Function(Program &P, FunctionDeclTy Source, unsigned ArgSize,
2323
ParamTypes(std::move(ParamTypes)), Params(std::move(Params)),
2424
ParamOffsets(std::move(ParamOffsets)), IsValid(false),
2525
IsFullyCompiled(false), HasThisPointer(HasThisPointer), HasRVO(HasRVO),
26-
Defined(false) {
26+
HasBody(false), Defined(false) {
2727
if (const auto *F = dyn_cast<const FunctionDecl *>(Source)) {
2828
Variadic = F->isVariadic();
2929
Immediate = F->isImmediateFunction();

0 commit comments

Comments
 (0)