4

I am trying apply clang-tidy to my project, but run into the problem that it only renames member variables in the header, but not the occurrences in the cpp files:

E.g. I have a class member named "my_member" in the header file. This gets renamed by clang-tidy to "my_member_". But all occurrences in the cpp file are not touched. (it changes other stuff in the cpp. So it is not the case that it doesnt know about the cpp file).

Is this expected behaviour? If not, how can I fix this?

Example: Original header file:

#ifndef TESTCLASS_H
#define TESTCLASS_H


class TestClass
{
 public:
  TestClass();

 private:
  float my_member;
};

#endif // TESTCLASS_H

The cpp file:

#include "testclass.h"

TestClass::TestClass()
{
  my_member = 0;
}

float my_member gets renamed to float my_member_, but the occurrence in the cpp stays the same.

I use clang-tidy-9.

veio
  • 507
  • 4
  • 16

0 Answers0