<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 --- - hasAncestor matcher crashes on certain constructs"
   href="https://llvm.org/bugs/show_bug.cgi?id=26227">26227</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>hasAncestor matcher crashes on certain constructs
          </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>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dcheng@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</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>