Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[index] Fix crash when indexing a C++14 PCH/module related to Templat…
…eTemplateParmDecls of alias templates TemplateTemplateParmDecls of alias templates ended-up serialized as 'file-level decls' which was causing a crash while trying to index a PCH/module file that contained them. Commit makes sure TemplateTemplateParmDecls are not recorded as such kind of decls. Fixes crash of rdar://36608297 Differential Revision: https://reviews.llvm.org/D42588 llvm-svn: 323549
- Loading branch information
Showing
3 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// RUN: c-index-test core -print-source-symbols -- %s -std=c++14 | FileCheck %s | ||
// RUN: %clang_cc1 -emit-pch %s -std=c++14 -o %t.pch | ||
// RUN: c-index-test core -print-source-symbols -module-file %t.pch | FileCheck %s | ||
|
||
// CHECK: [[@LINE+2]]:8 | struct(Gen)/C++ | DETECTOR | [[DETECTOR_USR:.*]] | {{.*}} | Def | rel: 0 | ||
template <class _Default, class _AlwaysVoid, template <class...> class _Op, class... _Args> | ||
struct DETECTOR { | ||
using value_t = int; | ||
}; | ||
|
||
struct nonesuch {}; | ||
|
||
// CHECK: [[@LINE+4]]:9 | type-alias/C++ | is_detected | ||
// CHECK: [[@LINE+3]]:32 | struct(Gen)/C++ | DETECTOR | [[DETECTOR_USR]] | {{.*}} | Ref,RelCont | rel: 1 | ||
// CHECK-NEXT: RelCont | is_detected | ||
template <template<class...> class _Op, class... _Args> | ||
using is_detected = typename DETECTOR<nonesuch, void, _Op, _Args...>::value_t; |