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
7 changes: 3 additions & 4 deletions clang/lib/Sema/AnalysisBasedWarnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,10 +983,9 @@ static void DiagUninitUse(Sema &S, const VarDecl *VD, const UninitUse &Use,
case UninitUse::AfterDecl:
case UninitUse::AfterCall:
S.Diag(VD->getLocation(), diag::warn_sometimes_uninit_var)
<< VD->getDeclName() << IsCapturedByBlock
<< (Use.getKind() == UninitUse::AfterDecl ? 4 : 5)
<< const_cast<DeclContext*>(VD->getLexicalDeclContext())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IT looks like this one goes back to 2013, so I am guessing it used to be const and that changed and this was just missed. The git archeology is not that hard it just requires a few --ignore-rev's. It would of course be nice if this actually worked on github instead of timing out.

<< VD->getSourceRange();
<< VD->getDeclName() << IsCapturedByBlock
<< (Use.getKind() == UninitUse::AfterDecl ? 4 : 5)
<< VD->getLexicalDeclContext() << VD->getSourceRange();
S.Diag(Use.getUser()->getBeginLoc(), diag::note_uninit_var_use)
<< IsCapturedByBlock << Use.getUser()->getSourceRange();
return;
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaConcept.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ DiagRecursiveConstraintEval(Sema &S, llvm::FoldingSetNodeID &ID,
// Sema::InstantiatingTemplate::isAlreadyBeingInstantiated function.
if (S.SatisfactionStackContains(Templ, ID)) {
S.Diag(E->getExprLoc(), diag::err_constraint_depends_on_self)
<< const_cast<Expr *>(E) << E->getSourceRange();
<< E << E->getSourceRange();
return true;
}

Expand Down
7 changes: 2 additions & 5 deletions clang/lib/Sema/SemaOpenACCAtomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,7 @@ class AtomicOperandChecker {
// If nothing matches, error out.
DiagnoseInvalidAtomic(BinInf->FoundExpr->getExprLoc(),
SemaRef.PDiag(diag::note_acc_atomic_mismatch_operand)
<< const_cast<Expr *>(AssignInf.LHS)
<< const_cast<Expr *>(BinInf->LHS)
<< const_cast<Expr *>(BinInf->RHS));
<< AssignInf.LHS << BinInf->LHS << BinInf->RHS);
return IDACInfo::Fail();
}

Expand Down Expand Up @@ -592,8 +590,7 @@ class AtomicOperandChecker {

PartialDiagnostic PD =
SemaRef.PDiag(diag::note_acc_atomic_mismatch_compound_operand)
<< FirstKind << const_cast<Expr *>(FirstX) << SecondKind
<< const_cast<Expr *>(SecondX);
<< FirstKind << FirstX << SecondKind << SecondX;

return DiagnoseInvalidAtomic(SecondX->getExprLoc(), PD);
}
Expand Down