Skip to content

parameter types are not renamed when fixing readability-identifier-naming.TypedefCase #54699

@LukasHanel

Description

@LukasHanel

Using clang-tidy, I try to rename typedefs, and find that clang-tidy fixes the header and variable declarations, but not parameter types in function signatures.
It is similar to this issue: #47147
I could not find other open issue, so I report it.

Using clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-, working with c .h and .c files.

.clang-tidy

Checks: "-*,readability-identifier-naming"
CheckOptions:
    - key:      readability-identifier-naming.TypedefCase
      value:    'camelBack'
    - key:      readability-identifier-naming.TypedefSuffix
      value:    '_t'

test.h

typedef struct {
    int x;
} ABC;

test.c

#include "test.h"
void fun(ABC a) {
    ABC b;
    size s=sizeof(ABC);
    ABC *c  = (ABC *)NULL;
}

is rewritten

test.h

typedef struct {
    int x;
} abc_t;

test.c

#include "test.h"
void fun(ABC a) {
    abc_t b;
    size s=sizeof(ABC);
    ABC *c  = (ABC *)NULL;
}

Type of parameter a not renamed.
Type ABC in sizeof is not renamed.
Pointer Type ABC* is not renamed.
Type ABC in cast is not renamed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions