<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Assertion `!Parents.empty() && "Found node that is not in the parent map."' failed in ast matcher"
href="https://llvm.org/bugs/show_bug.cgi?id=26257">26257</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assertion `!Parents.empty() && "Found node that is not in the parent map."' failed in ast matcher
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nicolasweber@gmx.de
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Add this to ASTMatchersTests.cpp, it'll crash because it can't find a parent
for
ParmVarDecl 0x2675740 <input.cc:3:28, col:32> col:32 used count 'int'
(which is the "count" param in the int-instantiated copy of the quantizedSize
template).
TEST(HasAncestor, FIXMEbettername) {
EXPECT_TRUE(matches("struct PartitionAllocator {\n"
" template<typename T>\n"
" static int quantizedSize(int count) {\n"
" return count;\n"
" }\n"
" void f() { quantizedSize<int>(10); }\n"
"};",
declRefExpr(to(decl(hasAncestor(decl()))))));
}
>From a spurious look, RecursiveASTVisitor visits ParmVarDecls through the
TypeSourceInformation, and it looks like the TypeSourceInformation for the
instantiation points to the template's ParmVarDecl, not to the instantiation's.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>