Sometimes in templated code Member references are reported as DependentScopeMemberExpr because that's what the standard dictates, however in many trivial cases it is easy to resolve the reference to its actual Member.
Take this code:
template<typename T> class A{ int value; A& operator=(const A& Other){ value = Other.value; this->value = Other.value; return *this; } };
When ran with clang-tidy file.cpp -checks=readability-identifier-naming --config="{CheckOptions: [{key: readability-identifier-naming.MemberPrefix, value: m_}]}" -fix
Current behaviour:
template<typename T> class A{ int m_value; A& operator=(const A& Other){ m_value = Other.value; this->value = Other.value; return *this; } };
As this->value and Other.value are Dependent they are ignored when creating the fix-its, however this can easily be resolved.
Proposed behaviour:
template<typename T> class A{ int m_value; A& operator=(const A& Other){ m_value = Other.m_value; this->m_value = Other.m_value; return *this; } };
Make these explicit?