[PATCH] D73052: [clang-tidy] RenamerClangTidy now renames dependent member expr when the member can be resolved

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 20 09:02:35 PST 2020


JonasToth added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp:282
+                        : DepMemberRef->getBaseType();
+    CXXRecordDecl *Base = BaseType.getTypePtr()->getAsCXXRecordDecl();
+    if (!Base)
----------------
can `Base` be a `const` pointer?

In which case will this pointer be a `nullptr`? Your test-cases seem to exercise only cases where `Base` is not-null.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-member-decl-usage.cpp:187
+};
+
+Derived<int> AInt{};
----------------
Could you please provide a test-case with non-type template parameters as well?

Another question but maybe/most likely off topic: are how are member-pointers handled? Both for data and member-functions.
-> Maybe a test-case for such a situation would be good, as well? :)

Crème de la Crème would be if templated member-pointers are treated properly, too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73052/new/

https://reviews.llvm.org/D73052





More information about the cfe-commits mailing list