[llvm-bugs] [Bug 26257] New: Assertion `!Parents.empty() && "Found node that is not in the parent map."' failed in ast matcher

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 22 09:30:37 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26257

            Bug ID: 26257
           Summary: Assertion `!Parents.empty() && "Found node that is not
                    in the parent map."' failed in ast matcher
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160122/5a677c3a/attachment.html>


More information about the llvm-bugs mailing list