From: Jason Merrill Date: Sun, 17 Mar 2013 02:37:33 +0000 (-0400) Subject: * search.c (lookup_base): Handle NULL_TREE. X-Git-Tag: upstream/12.2.0~70842 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca2e264dd6e2eb677baebf6ebdad9d5f5dfcdbcd;p=platform%2Fupstream%2Fgcc.git * search.c (lookup_base): Handle NULL_TREE. From-SVN: r196738 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5b28025..c0e1542 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ 2013-03-16 Jason Merrill + * 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 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)