* search.c (lookup_base): Handle NULL_TREE.
authorJason Merrill <jason@redhat.com>
Sun, 17 Mar 2013 02:37:33 +0000 (22:37 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 17 Mar 2013 02:37:33 +0000 (22:37 -0400)
From-SVN: r196738

gcc/cp/ChangeLog
gcc/cp/search.c

index 5b28025defb7f8a775efd7d6223f05e3375019df..c0e15426719fed322ff7a2bb9188bef880bd5ffd 100644 (file)
@@ -1,5 +1,7 @@
 2013-03-16  Jason Merrill  <jason@redhat.com>
 
+       * search.c (lookup_base): Handle NULL_TREE.
+
        PR c++/56481
        * semantics.c (potential_constant_expression_1): Use of 'this' in
        a non-constexpr function makes the expression not potentially
index 4cc02ba7dfc149944570cf3e6345933af8fd6821..54a5e4ae75db6b9fea3f084e48af1d95635fb4d6 100644 (file)
@@ -188,6 +188,14 @@ lookup_base (tree t, tree base, base_access access,
   tree t_binfo;
   base_kind bk;
 
+  /* "Nothing" is definitely not derived from Base.  */
+  if (t == NULL_TREE)
+    {
+      if (kind_ptr)
+       *kind_ptr = bk_not_base;
+      return NULL_TREE;
+    }
+
   if (t == error_mark_node || base == error_mark_node)
     {
       if (kind_ptr)