[PATCH] D49760: [clang:sema] de-duplicate getDepthAndIndex helpers

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 24 14:37:27 PDT 2018


vsk added a comment.

Thanks for doing this!



================
Comment at: include/clang/Sema/SemaInternal.h:120
+  if (const TemplateTypeParmType *TTP =
+          UPP.first.dyn_cast<const TemplateTypeParmType *>())
+    return std::make_pair(TTP->getDepth(), TTP->getIndex());
----------------
Perhaps 'const auto *TTP = ...' would read better here, given that the expected type appears once already in the r.h.s of the expression? I have the same comment re: the three other casts above.


Repository:
  rC Clang

https://reviews.llvm.org/D49760





More information about the cfe-commits mailing list