================
@@ -227,6 +228,28 @@ TEST(DumpASTTests, UnbalancedBraces) {
ASSERT_EQ(Node.range, Case.range("func"));
}
+bool hasDetail(const ASTNode &Node, llvm::StringRef Detail) {
+ if (Node.detail == Detail)
+ return true;
+ return llvm::any_of(Node.children, [&Detail](const ASTNode &Child) {
+ return hasDetail(Child, Detail);
+ });
+}
+
+TEST(DumpASTTests, PackIndexedConcept) {
+ auto TU = TestTU::withCode(R"cpp(
+template <template <class> concept... CC, CC...[0] T>
+void func(T);
+ )cpp");
+ TU.ExtraArgs = {"-std=c++2d"};
+ ParsedAST AST = TU.build();
+ const ASTNode Node = dumpAST(
+ DynTypedNode::create(*AST.getASTContext().getTranslationUnitDecl()),
+ AST.getTokens(), AST.getASTContext());
+
+ EXPECT_TRUE(hasDetail(Node, "CC...[0]"));
+}
+
----------------
cor3ntin wrote:
I had to make changes to clangd so I'd rather keep the tests
https://github.com/llvm/llvm-project/pull/218738
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits