[all-commits] [llvm/llvm-project] 6f7d82: [Clang][Sema]: Diagnose lambda to bool implicit ca...

Vinayak Dev via All-commits all-commits at lists.llvm.org
Thu Feb 29 06:09:51 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f7d824b804b272335d55f5b899295db833f3829
      https://github.com/llvm/llvm-project/commit/6f7d824b804b272335d55f5b899295db833f3829
  Author: Vinayak Dev <104419489+vinayakdsci at users.noreply.github.com>
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/CXX/drs/dr18xx.cpp
    M clang/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm
    M clang/test/SemaCXX/warn-bool-conversion.cpp

  Log Message:
  -----------
  [Clang][Sema]: Diagnose lambda to bool implicit casts (#83152)

Adds diagnostics for lambda expressions being cast to boolean values,
which results in the expression always evaluating to true.
Earlier, Clang allowed compilation of such erroneous programs, but now
emits a warning through `-Wpointer-bool-conversion`.

Fixes #82512



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list