]> granicus.if.org Git - clang/commitdiff
[libclang] Encode InjectedClassNameType in the USR.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 8 Dec 2014 08:48:43 +0000 (08:48 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 8 Dec 2014 08:48:43 +0000 (08:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223634 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Index/USRGeneration.cpp
test/Index/usrs.cpp

index 29a1b3dcd1254ee3e2008ff00c3a9bfe468b42fa..d03d238e34d91e45c7ab74c2bd990155075ba177 100644 (file)
@@ -706,6 +706,10 @@ void USRGenerator::VisitType(QualType T) {
       Out << ':' << DNT->getIdentifier()->getName();
       return;
     }
+    if (const InjectedClassNameType *InjT = T->getAs<InjectedClassNameType>()) {
+      T = InjT->getInjectedSpecializationType();
+      continue;
+    }
     
     // Unhandled type.
     Out << ' ';
index 95d121d482986316ac4d89af8c53cde706a3f58f..3003fc5c003182d4bac63202e4679db4f2960681 100644 (file)
@@ -90,6 +90,11 @@ void funWithChar(signed char c) {}
 struct { int x; } embedS1;
 struct { int x; } embedS2;
 
+template <typename T>
+class TC1 {
+  void meth(TC1);
+};
+
 // RUN: c-index-test -test-load-source-usrs all %s | FileCheck %s
 // CHECK: usrs.cpp c:@N@foo Extent=[1:1 - 4:2]
 // CHECK: usrs.cpp c:@N@foo@x Extent=[2:3 - 2:8]
@@ -165,3 +170,5 @@ struct { int x; } embedS2;
 
 // CHECK: usrs.cpp c:usrs.cpp@S@usrs.cpp@1483@FI@x Extent=[90:10 - 90:15]
 // CHECK: usrs.cpp c:usrs.cpp@S@usrs.cpp@1510@FI@x Extent=[91:10 - 91:15]
+
+// CHECK: usrs.cpp c:@ST>1#T@TC1@F@meth#>@ST>1#T@TC11t0.0# Extent=[95:3 - 95:17]