Skip to content

[clang-tidy] readability-named-parameter shouldn't comment out parameter names in function declaration #123646

@LegalizeAdulthood

Description

Suppose you have the following declaration:

static void transform(DblCoords *);

when readability-named-parameter is run, the code becomes:

static void transform(DblCoords * /*point*/);

Since this is a declaration, not a definition, the parameter name should not be commented out.

To reproduce:

  1. git clone https://github.com/LegalizeAdulthood/iterated-dynamics.git
  2. git checkout 784b6062108a0d56d2e84313e975a5b04981d62f
  3. git submodule init
  4. git submodule update
  5. Configure with cmake, e.g. cmake --preset default
  6. Run readability-named-parameter on loadfile.cpp, line 175

Metadata

Assignees

No one assigned

    Labels

    clang-tidyenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions