[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #95112)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 17 02:33:31 PDT 2024


================
@@ -222,18 +222,13 @@ static bool DiagnoseNoDiscard(Sema &S, const WarnUnusedResultAttr *A,
   return S.Diag(Loc, diag::warn_unused_result_msg) << A << Msg << R1 << R2;
 }
 
-void Sema::DiagnoseUnusedExprResult(const Stmt *S, unsigned DiagID) {
-  const unsigned OrigDiagID = DiagID;
-  if (const LabelStmt *Label = dyn_cast_or_null<LabelStmt>(S))
-    return DiagnoseUnusedExprResult(Label->getSubStmt(), DiagID);
-
-  const Expr *E = dyn_cast_or_null<Expr>(S);
-  if (!E)
-    return;
+namespace {
----------------
Sirraide wrote:

For functions, we typically mark them as `static` rather than using an anonymous namespace.

https://github.com/llvm/llvm-project/pull/95112


More information about the cfe-commits mailing list