[PATCH] D72281: [Matrix] Add matrix type to Clang.
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 4 20:59:56 PDT 2020
rjmccall added inline comments.
================
Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:2112
+ llvm::APSInt ArgRows(S.Context.getTypeSize(S.Context.IntTy),
+ ConstantMatrixArg->getNumRows());
+ Result = DeduceNonTypeTemplateArgument(
----------------
Oh, and this needs to use `size_t`; not just the value but the type of a non-type template parameter can be deduced, so you should use an appropriate type. Test case for this deduction is `template <auto R> void foo(matrix<int, R, 10>);` or something like that, with a check that `decltype(R)` is `size_t` (which you can do in any number of ways).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72281/new/
https://reviews.llvm.org/D72281
More information about the cfe-commits
mailing list