This revision was automatically updated to reflect the committed changes.
Closed by commit rL315367: Fix indexer crash for default template template 
parameter value (authored by jkorous).

Changed prior to commit:
  https://reviews.llvm.org/D38755?vs=118451&id=118476#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38755

Files:
  cfe/trunk/lib/Index/IndexDecl.cpp
  cfe/trunk/test/Index/index-template-template-param.cpp


Index: cfe/trunk/lib/Index/IndexDecl.cpp
===================================================================
--- cfe/trunk/lib/Index/IndexDecl.cpp
+++ cfe/trunk/lib/Index/IndexDecl.cpp
@@ -666,7 +666,6 @@
   }
 
   bool VisitTemplateDecl(const TemplateDecl *D) {
-    // FIXME: Template parameters.
 
     // Index the default values for the template parameters.
     const NamedDecl *Parent = D->getTemplatedDecl();
@@ -683,7 +682,7 @@
         } else if (const auto *TTPD = dyn_cast<TemplateTemplateParmDecl>(TP)) {
           if (TTPD->hasDefaultArgument())
             handleTemplateArgumentLoc(TTPD->getDefaultArgument(), Parent,
-                                      /*DC=*/nullptr);
+                                      TP->getLexicalDeclContext());
         }
       }
     }
Index: cfe/trunk/test/Index/index-template-template-param.cpp
===================================================================
--- cfe/trunk/test/Index/index-template-template-param.cpp
+++ cfe/trunk/test/Index/index-template-template-param.cpp
@@ -0,0 +1,7 @@
+// RUN: c-index-test -index-file %s -x objective-c++ | FileCheck %s
+
+template <typename T> class Template1 {};
+
+template <template <class> class TMPL = Template1> class Template2;
+
+// CHECK: [indexEntityReference]: kind: c++-class-template | name: Template1 |


Index: cfe/trunk/lib/Index/IndexDecl.cpp
===================================================================
--- cfe/trunk/lib/Index/IndexDecl.cpp
+++ cfe/trunk/lib/Index/IndexDecl.cpp
@@ -666,7 +666,6 @@
   }
 
   bool VisitTemplateDecl(const TemplateDecl *D) {
-    // FIXME: Template parameters.
 
     // Index the default values for the template parameters.
     const NamedDecl *Parent = D->getTemplatedDecl();
@@ -683,7 +682,7 @@
         } else if (const auto *TTPD = dyn_cast<TemplateTemplateParmDecl>(TP)) {
           if (TTPD->hasDefaultArgument())
             handleTemplateArgumentLoc(TTPD->getDefaultArgument(), Parent,
-                                      /*DC=*/nullptr);
+                                      TP->getLexicalDeclContext());
         }
       }
     }
Index: cfe/trunk/test/Index/index-template-template-param.cpp
===================================================================
--- cfe/trunk/test/Index/index-template-template-param.cpp
+++ cfe/trunk/test/Index/index-template-template-param.cpp
@@ -0,0 +1,7 @@
+// RUN: c-index-test -index-file %s -x objective-c++ | FileCheck %s
+
+template <typename T> class Template1 {};
+
+template <template <class> class TMPL = Template1> class Template2;
+
+// CHECK: [indexEntityReference]: kind: c++-class-template | name: Template1 |
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to