fix abi (again) · llvm/llvm-project@2dc152f (original) (raw)

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -10673,7 +10673,7 @@ class Sema final : public SemaBase {
10673 10673
10674 10674
10675 10675 // Unused, kept in Clang 20 for ABI stability.
10676 - void DiagnoseDiscardedExprMarkedNodiscard(const Expr *E) {};
10676 + void DiagnoseDiscardedExprMarkedNodiscard(const Expr *E);
10677 10677
10678 10678 /// DiagnoseUnusedExprResult - If the statement passed in is an expression
10679 10679 /// whose result is unused, warn.
Original file line number Diff line number Diff line change
@@ -413,6 +413,10 @@ void DiagnoseUnused(Sema &S, const Expr *E, std::optional DiagID) {
413 413 }
414 414 } // namespace
415 415
416 +void Sema::DiagnoseDiscardedExprMarkedNodiscard(const Expr *E) {
417 +DiagnoseUnused(*this, E, std::nullopt);
418 +}
419 +
416 420 void Sema::DiagnoseUnusedExprResult(const Stmt *S, unsigned DiagID) {
417 421 if (const LabelStmt *Label = dyn_cast_if_present(S))
418 422 S = Label->getSubStmt();