[all-commits] [llvm/llvm-project] a61ea9: [clang-tidy] Add an option in 'readability-named-p...

Dmitry Polukhin via All-commits all-commits at lists.llvm.org
Fri Jul 11 03:51:41 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a61ea9fd9b9c100ce4fce9212dc85230257fd5c8
      https://github.com/llvm/llvm-project/commit/a61ea9fd9b9c100ce4fce9212dc85230257fd5c8
  Author: Dmitry Polukhin <34227995+dmpolukhin at users.noreply.github.com>
  Date:   2025-07-11 (Fri, 11 Jul 2025)

  Changed paths:
    M clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp
    M clang-tools-extra/clang-tidy/readability/NamedParameterCheck.h
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/readability/named-parameter.rst
    M clang-tools-extra/test/clang-tidy/checkers/readability/named-parameter.cpp

  Log Message:
  -----------
  [clang-tidy] Add an option in 'readability-named-parameter' to print names without comment (#147953)

Add InsertPlainNamesInForwardDecls option to readability-named-parameter
check to insert parameter names without comments for forward
declarations only.

When enabled, forward declarations get plain parameter names (e.g., `int
param`) while function definitions continue to use commented names
(e.g., `int /*param*/`). Named parameters in forward decls don't cause
compiler warnings and some developers prefer to have names without
comments but in sync between declarations and the definition.

Default behavior remains unchanged
(InsertPlainNamesInForwardDecls=false).

Example with InsertPlainNamesInForwardDecls=true:
```cpp
// Forward declaration - gets plain name because the definition has name.
void func(int param);
void func(int param) { ... = param; }
```



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