[PATCH] D139409: [include-cleaner] Handle dependent type members in AST

Viktoriia Bakalova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 19 01:36:27 PST 2022


VitaNuo added a comment.

Thanks for the comments!



================
Comment at: clang-tools-extra/include-cleaner/lib/WalkAST.cpp:51
       Type = Type->getPointeeType();
+    if (const TemplateSpecializationType *TST =
+            Type->getAs<TemplateSpecializationType>()) {
----------------
hokein wrote:
> nit: we can use `const auto*` here as the type is explicitly spelled in the `getAs<XXX>`
Seems to be obsolete with the above patch.


================
Comment at: clang-tools-extra/include-cleaner/lib/WalkAST.cpp:52
+    if (const TemplateSpecializationType *TST =
+            Type->getAs<TemplateSpecializationType>()) {
+      return TST->getTemplateName().getAsTemplateDecl();
----------------
hokein wrote:
> nit: remove the {} around the if statement
Seems to be obsolete with the above patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139409



More information about the cfe-commits mailing list