[PATCH] D41575: [index] Return when DC is null in handleReference

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 8 18:28:41 PST 2018


MaskRay added a comment.

In https://reviews.llvm.org/D41575#970412, @akyrtzi wrote:

> Ah, sorry I mislead you. To test this try using `c-index-test -index-file /path/to/file`, see other examples in `test/Index`, e.g. `test/Index/index-file.cpp`


Thanks for the command. It is really helpful. I have re-run cquery with or without the `!DC` patch (on git-svn HEAD) and see no libclang crash. I guess this issue was in somewhere else and in these weeks it has been fixed.

  zsh
  % cat a.cc
  template <typename>
  struct actor;
  
  template <template <typename> class Actor = actor>
  struct terminal;
  
  # Arch Linux extra/clang 5.0.1-1
  % c-index-test -index-file a.cc
  [startedTranslationUnit]
  [enteredMainFile]: a.cc
  [indexEntityReference]: kind: c++-class-template | name: actor | USR: c:@ST>1#T at actor | lang: C++ | cursor: TypeRef=actor<type-parameter-0-0>:2:8 | loc: 2:8 | <parent>:: <<NULL>> | container: [TU] | refkind: direct
  libclang: crash detected during indexing source file: {
    'source_filename' : '(null)'
    'command_line_args' : ['clang', 'a.cc'],
    'unsaved_files' : [],
    'options' : 1,
  }
  Failure (no details available)
  
  
  # llvm+clang git-svn HEAD
  % ~/Dev/llvm/release/bin/c-index-test -index-file a.cc
  # no failure
  
  % ~/Dev/llvm/release/bin/c-index-test -index-file test/src/unit-cbor.cpp -Isrc -Itest/thirdparty/catch -std=c++11 -resource-dir ~/Dev/llvm/release/lib/clang/7.0.0
  # no failure


Repository:
  rL LLVM

https://reviews.llvm.org/D41575





More information about the cfe-commits mailing list