[all-commits] [llvm/llvm-project] 26d082: [clang-tidy][performance-unnecessary-value-param] ...

Dmitry Polukhin via All-commits all-commits at lists.llvm.org
Tue Jun 17 01:47:37 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 26d082d330e4d8d1fc3194b4b87ede9332a297f5
      https://github.com/llvm/llvm-project/commit/26d082d330e4d8d1fc3194b4b87ede9332a297f5
  Author: Dmitry Polukhin <34227995+dmpolukhin at users.noreply.github.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp
    M clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.h
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-value-param.rst
    A clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-value-param-coroutine.cpp

  Log Message:
  -----------
  [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (#140912)

Summary:
Replacing by-value parameters with passing by-reference is not safe for
coroutines because the caller may be executed in parallel with the
callee, which increases the chances of resulting in dangling references
and hard-to-find crashes. See for the reference
[cppcoreguidelines-avoid-reference-coroutine-parameters](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-reference-coroutine-parameters.html).

Test Plan: check-clang-tools



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