This function ought to handle null T. Tested x86_64-pc-linux-gnu, applying to trunk.
commit 5ce73161422bffd51252e639ad2da79df31438ee Author: Jason Merrill <ja...@redhat.com> Date: Tue Mar 5 12:38:34 2013 -0500
* search.c (lookup_base): Handle NULL_TREE. diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 4cc02ba..54a5e4a 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -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)