[PATCH] D152495: [Clang][SemaCXX] Add unused warning for variables declared in condition expressions

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 9 02:28:01 PDT 2023


tbaeder added inline comments.


================
Comment at: clang/lib/CodeGen/CGExpr.cpp:2852
-         "Should not use decl without marking it used!");
-
   if (ND->hasAttr<WeakRefAttr>()) {
----------------
Question for other reviewers: If we want to keep this assertion, would it instead make sense to mark the decl as used after emitting the diagnostic, in https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaDecl.cpp#L2154 ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152495/new/

https://reviews.llvm.org/D152495



More information about the cfe-commits mailing list