[clang][NFC] Remove const_casts from diagnostic emissions (#161211)
This is apparently not necessary anymore. Not sure when exactly it changed though.
This commit is contained in:
parent
27fa1d0cf9
commit
c2fbd12f11
@ -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())
|
||||
<< 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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user