[clang] [clang][Sema] Deprecate `global`/`unknown` in `lifetime_capture_by` (PR #196635)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 10 04:53:11 PDT 2026


usx95 wrote:

1. I see that `warn_deprecated_capture_by_special_entity` is not added to any diag group. So `-Wno-deprecated-attributes` would not work at the moment. So it should be added to `DeprecatedAttributes` diag group.
2. I am actually in favour of having a subgroup under `-Wdeprecated-attributes` (say `-Wdeprecated-attributes-lifetime-capture-by`) because `-Wno-deprecated-attributes` might be too wide and users may miss future deprecations since these silences tend to stay for long. In the next-next release, we would remove support of this spelling completely and would remove the sub-category as well making this a hard-error.

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


More information about the cfe-commits mailing list