[PATCH] D59354: [clangd] Print arguments in template specializations
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 15 03:55:52 PDT 2019
kadircet added inline comments.
================
Comment at: clang/lib/AST/TypePrinter.cpp:1655
+ case TemplateArgument::ArgKind::Expression:
+ case TemplateArgument::ArgKind::Pack:
+ A.getArgument().print(PP, OS);
----------------
ilya-biryukov wrote:
> Now that you mentioned other kinds of parameters, could you add tests for other kinds of parameters?
> In particular, I expect we'll definitely need to handle packs here and probably all other kinds of arguments too.
> - Non-type and template template parameters.
> ```
> template <int I, int J, template<class> class TT, template <class> class JJ>
> struct Foo {};
>
> template <int X, template <class> class UU>
> struct Foo<X, X, UU, UU> {};
> ```
> - Parameter packs.
> ```
> template <class ...T>
> struct Bar {};
>
> template <class T>
> struct Bar<T, T> {};
>
> template <int ...I>
> struct Baz {};
>
> template <int I>
> struct Baz<I, I> {};
>
> template <template <class> class...TT>
> struct Qux {};
>
> template <template <class> class TT>
> struct Qux<TT, TT> {};
> ```
I've already had tests for these cases, but adding a few more for partial specs as well.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59354/new/
https://reviews.llvm.org/D59354
More information about the cfe-commits
mailing list