[clang] Warn by default that implicit capture of 'this' is deprecated in C++20 and...
authorTom Honermann <tom.honermann@intel.com>
Thu, 26 Jan 2023 15:32:27 +0000 (07:32 -0800)
committerTom Honermann <tom@honermann.net>
Thu, 2 Feb 2023 20:10:47 +0000 (15:10 -0500)
commitecd0be100bed5bae1f22d3da28bfcca89934af8c
tree339736c276df7ff50a01dcd98d1c634acf8d258e
parent726ba82554132003c2bd1ca6143cdd142dba5f86
[clang] Warn by default that implicit capture of 'this' is deprecated in C++20 and later.

Previously, a warning that C++20 deprecated implicit capture of 'this' for
lambda captures specified with a capture default of '=' was only issued when
'-Wdeprecated' or '-Wdeprecated-this-capture' was specified. This change
enables the warning by default (it is still only issued when compiling for
C++20 or later). This is consistent with gcc which warns by default (MSVC
requires '/Wall').

Reviewed By: erichkeane, shafik

Differential Revision: https://reviews.llvm.org/D142639
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp
clang/test/SemaCXX/cxx2a-lambda-equals-this.cpp
clang/test/SemaCXX/lambda-implicit-this-capture.cpp [new file with mode: 0644]