re PR c++/85146 (ICE with __direct_bases for declared but not defined struct)
authorJakub Jelinek <jakub@redhat.com>
Wed, 4 Apr 2018 19:34:18 +0000 (21:34 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 4 Apr 2018 19:34:18 +0000 (21:34 +0200)
commit628a15343e494e457c647347e879c69a62016e0c
treebe0e52b9e5a853ce7d421833b2bda0d3e3c369c3
parent001db6cf52711f785459558508ca6fa97e10bcae
re PR c++/85146 (ICE with __direct_bases for declared but not defined struct)

PR c++/85146
* cp-tree.h (calculate_bases, calculate_direct_bases): Add complain
argument.
* semantics.c (calculate_bases): Add complain argument.  Use
complete_type_or_maybe_complain instead of just complete_type and
return an empty vector if it fails.  Move make_tree_vector () call
after early return.  Formatting fixes.
(calculate_direct_bases): Likewise.  Call release_tree_vector at the
end.
(dfs_calculate_bases_post, calculate_bases_helper): Formatting fixes.
* pt.c (tsubst_pack_expansion): Adjust calculate_bases and
calculate_direct_bases callers, formatting fixes.

* g++.dg/ext/bases2.C: Expect extra error diagnostics.
* g++.dg/ext/bases3.C: New test.

From-SVN: r259101
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/bases2.C
gcc/testsuite/g++.dg/ext/bases3.C [new file with mode: 0644]