[llvm-bugs] [Bug 26227] New: hasAncestor matcher crashes on certain constructs

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 20 17:28:35 PST 2016


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

            Bug ID: 26227
           Summary: hasAncestor matcher crashes on certain constructs
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dcheng at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

We hit this assert when we were testing a tool to automatically rename things:

$ third_party/llvm-build/Release+Asserts/bin/rewrite_to_chrome_style test.cc
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "test.cc"
No compilation database found in /usr/local/google/home/dcheng/src/chrome/src
or any parent directory
json-compilation-database: Error while opening JSON database: No such file or
directory
Running without flags.
rewrite_to_chrome_style:
/usr/local/google/ssd/src/chrome/src/third_party/llvm/tools/clang/lib/ASTMatchers/ASTMatchFinder.cpp:637:
bool
clang::ast_matchers::internal::{anonymous}::MatchASTVisitor::memoizedMatchesAncestorOfRecursively(const
clang::ast_type_traits::DynTypedNode&, const
clang::ast_matchers::internal::DynTypedMatcher&,
clang::ast_matchers::internal::BoundNodesTreeBuilder*,
clang::ast_matchers::internal::ASTMatchFinder::AncestorMatchMode): Assertion
`!Parents.empty() && "Found node that is not in the parent map."' failed.
Aborted (core dumped)

The reduced repro from danakj@:
$ cat test.cc
class MyClass {
  int c[1];

 public:
  static MyClass Create() { return MyClass(); }
};

>From our debugging, it looks like the assert occurs when trying to match
ancestors of the initializer in the compiler-generated move ctor.

-- 
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/20160121/d696a11b/attachment.html>


More information about the llvm-bugs mailing list