summaryrefslogtreecommitdiffstats
path: root/test/Index
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2018-01-26 19:26:12 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2018-01-26 19:26:12 +0000
commitca1d83bc4fad52c8e3ea365a1fc1247c7dc6db40 (patch)
tree3884ba991dc3216a5533d399c4941cab066434eb /test/Index
parent71f3942a168f5298872a359d4cf9be2da98223b3 (diff)
[index] Fix crash when indexing a C++14 PCH/module related to TemplateTemplateParmDecls 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323549 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index')
-rw-r--r--test/Index/Core/index-pch.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Index/Core/index-pch.cpp b/test/Index/Core/index-pch.cpp
new file mode 100644
index 0000000000..8c5a92b612
--- /dev/null
+++ b/test/Index/Core/index-pch.cpp
@@ -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;