* pt.c (retrieve_specialization): Handle null tmpl argument.
authorJason Merrill <jason@redhat.com>
Thu, 21 Mar 2013 03:25:23 +0000 (23:25 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 21 Mar 2013 03:25:23 +0000 (23:25 -0400)
From-SVN: r196850

gcc/cp/ChangeLog
gcc/cp/pt.c

index 4191c86..bef6fae 100644 (file)
@@ -1,5 +1,7 @@
 2013-03-20  Jason Merrill  <jason@redhat.com>
 
+       * pt.c (retrieve_specialization): Handle null tmpl argument.
+
        PR c++/17232
        PR c++/56642
        * pt.c (tsubst_decl): Check return value of register_specialization.
index 531d860..d56ffed 100644 (file)
@@ -1009,6 +1009,9 @@ optimize_specialization_lookup_p (tree tmpl)
 static tree
 retrieve_specialization (tree tmpl, tree args, hashval_t hash)
 {
+  if (tmpl == NULL_TREE)
+    return NULL_TREE;
+
   if (args == error_mark_node)
     return NULL_TREE;