[PATCH] D134416: Allow getting template args for ClassTemplateSpecializations

Anders Langlands via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 22 22:51:27 PDT 2022


anderslanglands added a comment.

I ended up modifying c-index-test to print out the template arguments in the same way it does for FunctionDecl, which ends up working all cases in the existing test suite. The only other thing I added was a specific case in index-templates.cpp to check whether it catches StructDecl too (it does).



================
Comment at: clang/tools/libclang/CXCursor.cpp:1357
+  CXCursorKind kind = clang_getCursorKind(C);
+  if (kind != CXCursor_FunctionDecl && kind != CXCursor_StructDecl &&
+      kind != CXCursor_ClassDecl &&
----------------
aaron.ballman wrote:
> `CXCursor_StructDecl` is interesting -- does that only get used in C or will it also show up in C++? If it's C-only, we can drop that bit.
It does. I added a case to index-templates.cpp that tests for this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134416



More information about the cfe-commits mailing list