diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-03-17 02:37:33 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-03-17 02:37:33 +0000 |
commit | 7341fceade35b9efb27a6f7e406b3c7096947836 (patch) | |
tree | d9789b0249ac2541f2232a3bff6da282ccbe9a40 /gcc | |
parent | 69ed07ff6653de4fd0543fbd05493c65d11cdeed (diff) | |
download | gcc-7341fceade35b9efb27a6f7e406b3c7096947836.tar.gz |
* search.c (lookup_base): Handle NULL_TREE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196738 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/cp/search.c | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5b28025defb..c0e15426719 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 4cc02ba7dfc..54a5e4ae75d 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) |