summaryrefslogtreecommitdiff
path: root/test/Index/Core/index-source.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-05-12 16:32:26 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-05-12 16:32:26 +0000
commit1ab21368623ebeaebdc46344ff57890f767450ee (patch)
treeb06783ad3f2935c2eb6d4707ca44aa70f010cf29 /test/Index/Core/index-source.cpp
parent1635c9f0a045570754fadc744ee7aa16fd482158 (diff)
downloadclang-1ab21368623ebeaebdc46344ff57890f767450ee.tar.gz
[index] Index template specialization arguments for function templats
Also ensure that class template specialization arguments are covered rdar://31812032 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302918 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/Core/index-source.cpp')
-rw-r--r--test/Index/Core/index-source.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Index/Core/index-source.cpp b/test/Index/Core/index-source.cpp
index 6f902610e6..cae7508c5f 100644
--- a/test/Index/Core/index-source.cpp
+++ b/test/Index/Core/index-source.cpp
@@ -287,3 +287,30 @@ class PartialSpecilizationClass<Cls, Cls> : Cls { };
// CHECK-NEXT: [[@LINE-5]]:7 | class(Gen)/C++ | PartialSpecilizationClass | c:@ST>2#T#T@PartialSpecilizationClass | <no-cgname> | Ref | rel: 0
// CHECK-NEXT: [[@LINE-6]]:33 | class/C++ | Cls | c:@S@Cls | <no-cgname> | Ref | rel: 0
// CHECK-NEXT: [[@LINE-7]]:38 | class/C++ | Cls | c:@S@Cls | <no-cgname> | Ref | rel: 0
+
+template<typename T, int x>
+void functionSp() { }
+
+struct Record {
+ constexpr static int C = 2;
+};
+
+template<>
+void functionSp<SpecializationDecl<Cls>, Record::C>() {
+// CHECK: [[@LINE-1]]:6 | function(Gen,TS)/C++ | functionSp | c:@F@functionSp<#$@S@SpecializationDecl>#$@S@Cls#VI2># | __Z10functionSpI18SpecializationDeclI3ClsELi2EEvv | Def,RelSpecialization | rel: 1
+// CHECK: RelSpecialization | functionSp | c:@FT@>2#T#NIfunctionSp#v#
+// CHECK: [[@LINE-3]]:17 | class(Gen)/C++ | SpecializationDecl | c:@ST>1#T@SpecializationDecl | <no-cgname> | Ref,RelCont | rel: 1
+// CHECK: [[@LINE-4]]:36 | class/C++ | Cls | c:@S@Cls | <no-cgname> | Ref,RelCont | rel: 1
+// CHECK: [[@LINE-5]]:50 | static-property/C++ | C | c:@S@Record@C | __ZN6Record1CE | Ref,RelCont | rel: 1
+// CHECK: [[@LINE-6]]:42 | struct/C++ | Record | c:@S@Record | <no-cgname> | Ref,RelCont | rel: 1
+}
+
+template<typename T, int x>
+class ClassWithCorrectSpecialization { };
+
+template<>
+class ClassWithCorrectSpecialization<SpecializationDecl<Cls>, Record::C> { };
+// CHECK: [[@LINE-1]]:38 | class(Gen)/C++ | SpecializationDecl | c:@ST>1#T@SpecializationDecl | <no-cgname> | Ref | rel: 0
+// CHECK: [[@LINE-2]]:57 | class/C++ | Cls | c:@S@Cls | <no-cgname> | Ref | rel: 0
+// CHECK: [[@LINE-3]]:71 | static-property/C++ | C | c:@S@Record@C | __ZN6Record1CE | Ref,Read | rel: 0
+// CHECK: [[@LINE-4]]:63 | struct/C++ | Record | c:@S@Record | <no-cgname> | Ref | rel: 0