[all-commits] [llvm/llvm-project] c98e86: [Clang] Fix false positive -Wignored-qualifiers (#...

Corentin Jabot via All-commits all-commits at lists.llvm.org
Wed Nov 26 10:18:58 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c98e867822d8e741159ff0be09ccc2a5c7841a28
      https://github.com/llvm/llvm-project/commit/c98e867822d8e741159ff0be09ccc2a5c7841a28
  Author: Corentin Jabot <corentinjabot at gmail.com>
  Date:   2025-11-26 (Wed, 26 Nov 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaStmt.cpp
    M clang/lib/Sema/SemaType.cpp
    M clang/test/SemaCXX/return.cpp

  Log Message:
  -----------
  [Clang] Fix false positive -Wignored-qualifiers (#169664)

A deduced return type can be an object type, in which case `const` can
have an effect.
Delay the diagnostic to the point at which the type is deduced. 
Add tests for lambdas.

Fixes #43054

Note that there is a discussion in #43054 about adding a separate
warning for "const return types are weird" for the class type cases, but
it would have to be a separate warning - warning which currently exists
in clang-tidy as `readability-const-return-type`.



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