Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/lib/Sema/AnalysisBasedWarnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ static ControlFlowKind CheckFallThrough(AnalysisDeclContext &AC) {
// mark them as live.
for (const auto *B : *cfg) {
if (!live[B->getBlockID()]) {
if (B->pred_begin() == B->pred_end()) {
if (B->preds().empty()) {
const Stmt *Term = B->getTerminatorStmt();
if (isa_and_nonnull<CXXTryStmt>(Term))
// When not adding EH edges from calls, catch clauses
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Sema/SemaDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5255,8 +5255,8 @@ Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
if (getLangOpts().CPlusPlus &&
DS.getStorageClassSpec() != DeclSpec::SCS_typedef)
if (EnumDecl *Enum = dyn_cast_or_null<EnumDecl>(Tag))
if (Enum->enumerator_begin() == Enum->enumerator_end() &&
!Enum->getIdentifier() && !Enum->isInvalidDecl())
if (Enum->enumerators().empty() && !Enum->getIdentifier() &&
!Enum->isInvalidDecl())
DeclaresAnything = false;

if (!DS.isMissingDeclaratorOk()) {
Expand Down
3 changes: 1 addition & 2 deletions clang/lib/Sema/SemaExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6523,8 +6523,7 @@ ExprResult Sema::ActOnCallExpr(Scope *Scope, Expr *Fn, SourceLocation LParenLoc,
// Diagnose uses of the C++20 "ADL-only template-id call" feature in earlier
// language modes.
if (const auto *ULE = dyn_cast<UnresolvedLookupExpr>(Fn);
ULE && ULE->hasExplicitTemplateArgs() &&
ULE->decls_begin() == ULE->decls_end()) {
ULE && ULE->hasExplicitTemplateArgs() && ULE->decls().empty()) {
DiagCompat(Fn->getExprLoc(), diag_compat::adl_only_template_id)
<< ULE->getName();
}
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4836,7 +4836,7 @@ static void TryReferenceListInitialization(Sema &S,
}

// Update the initializer if we've resolved an overloaded function.
if (Sequence.step_begin() != Sequence.step_end())
if (!Sequence.steps().empty())
Sequence.RewrapReferenceInitList(cv1T1, InitList);
}
// Perform address space compatibility check.
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3130,7 +3130,7 @@ addAssociatedClassesAndNamespaces(AssociatedLookup &Result,
CollectEnclosingNamespace(Result.Namespaces, BaseCtx);

// Make sure we visit the bases of this base class.
if (BaseDecl->bases_begin() != BaseDecl->bases_end())
if (!BaseDecl->bases().empty())
Bases.push_back(BaseDecl);
}
}
Expand Down