Skip to content

Commit 0cd5a1f

Browse files
authored
[NFC][clang] Cleanup in APValue and SemaInit (#127790)
APValue: Additional assignment of AllowConstexprUnknown is not required since it will be handled by copy constructor called above. SemaInit: Remove unnecessary null check. DestRecordDecl can't be null due to being obtained using `cast` and assertion that DestRecordType is present. Spotted by a static analysis tool.
1 parent 684ad25 commit 0cd5a1f

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

clang/lib/AST/APValue.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ APValue &APValue::operator=(const APValue &RHS) {
390390
if (this != &RHS)
391391
*this = APValue(RHS);
392392

393-
AllowConstexprUnknown = RHS.AllowConstexprUnknown;
394393
return *this;
395394
}
396395

clang/lib/Sema/SemaInit.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4577,7 +4577,6 @@ static void TryConstructorInitialization(Sema &S,
45774577
if (!IsListInit &&
45784578
(Kind.getKind() == InitializationKind::IK_Default ||
45794579
Kind.getKind() == InitializationKind::IK_Direct) &&
4580-
DestRecordDecl != nullptr &&
45814580
!(CtorDecl->isCopyOrMoveConstructor() && CtorDecl->isImplicit()) &&
45824581
DestRecordDecl->isAggregate() &&
45834582
DestRecordDecl->hasUninitializedExplicitInitFields()) {

0 commit comments

Comments
 (0)