[all-commits] [llvm/llvm-project] ecd0be: [clang] Warn by default that implicit capture of '...

Tom Honermann via All-commits all-commits at lists.llvm.org
Thu Feb 2 12:14:16 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ecd0be100bed5bae1f22d3da28bfcca89934af8c
      https://github.com/llvm/llvm-project/commit/ecd0be100bed5bae1f22d3da28bfcca89934af8c
  Author: Tom Honermann <tom.honermann at intel.com>
  Date:   2023-02-02 (Thu, 02 Feb 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp
    M clang/test/SemaCXX/cxx2a-lambda-equals-this.cpp
    A clang/test/SemaCXX/lambda-implicit-this-capture.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list