Skip to content

Commit 2dc152f

Browse files
cor3ntintstellar
authored andcommitted
fix abi (again)
1 parent 2044b18 commit 2dc152f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

clang/include/clang/Sema/Sema.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10673,7 +10673,7 @@ class Sema final : public SemaBase {
1067310673

1067410674

1067510675
// Unused, kept in Clang 20 for ABI stability.
10676-
void DiagnoseDiscardedExprMarkedNodiscard(const Expr *E) {};
10676+
void DiagnoseDiscardedExprMarkedNodiscard(const Expr *E);
1067710677

1067810678
/// DiagnoseUnusedExprResult - If the statement passed in is an expression
1067910679
/// whose result is unused, warn.

clang/lib/Sema/SemaStmt.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,10 @@ void DiagnoseUnused(Sema &S, const Expr *E, std::optional<unsigned> DiagID) {
413413
}
414414
} // namespace
415415

416+
void Sema::DiagnoseDiscardedExprMarkedNodiscard(const Expr *E) {
417+
DiagnoseUnused(*this, E, std::nullopt);
418+
}
419+
416420
void Sema::DiagnoseUnusedExprResult(const Stmt *S, unsigned DiagID) {
417421
if (const LabelStmt *Label = dyn_cast_if_present<LabelStmt>(S))
418422
S = Label->getSubStmt();

0 commit comments

Comments
 (0)