[PATCH] D132831: [clang][Interp] Handle SubstNonTypeTemplateParmExprs
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 2 12:21:16 PDT 2022
aaron.ballman accepted this revision.
aaron.ballman added a comment.
LGTM on the assumption that the extra test coverage doesn't find anything.
================
Comment at: clang/test/AST/Interp/functions.cpp:68-69
static_assert(recursion(10) == 0, "");
+
+
+template<int N>
----------------
================
Comment at: clang/test/AST/Interp/functions.cpp:70-75
+template<int N>
+constexpr decltype(N) getNum() {
+ return N;
+}
+static_assert(getNum<-2>() == -2, "");
+static_assert(getNum<10>() == 10, "");
----------------
Can you also add a use where there's a default argument for the NTTP just to make sure we get that right too? (I'd be surprised if it didn't.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132831/new/
https://reviews.llvm.org/D132831
More information about the cfe-commits
mailing list