Skip to content

Commit bcc1fb6

Browse files
committed
eliminate redundant if condition
1 parent 15babc9 commit bcc1fb6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

clang/lib/Sema/SemaDecl.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8494,11 +8494,9 @@ void Sema::CheckShadow(NamedDecl *D, NamedDecl *ShadowedDecl,
84948494
if (FieldDecl *FD = dyn_cast<FieldDecl>(ShadowedDecl)) {
84958495
if (CXXMethodDecl *MD =
84968496
dyn_cast<CXXMethodDecl>(getFunctionLevelDeclContext())) {
8497-
// Fields are not shadowed by variables in C++ static methods.
8498-
if (MD->isStatic())
8499-
return;
8500-
8501-
if (MD->isExplicitObjectMemberFunction())
8497+
// Fields aren't shadowed in C++ static members or in member functions
8498+
// with an explicit object parameter.
8499+
if (MD->isStatic() || MD->isExplicitObjectMemberFunction())
85028500
return;
85038501
}
85048502
// Fields shadowed by constructor parameters are a special case. Usually

0 commit comments

Comments
 (0)