]> git.ipfire.org Git - thirdparty/gcc.git/commit
* class.c (is_really_empty_class): Add ignore_vptr parm.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Mar 2019 22:17:13 +0000 (22:17 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Mar 2019 22:17:13 +0000 (22:17 +0000)
commitcd5a9ed1f359703439b230d251e0a2bbfd49d100
tree96f919af96a1d63fd5318191f716d125ff4b1c04
parent07b089176a78b3025a3c033f97cda7c12ffcae52
* class.c (is_really_empty_class): Add ignore_vptr parm.

While looking at PR86485, I noticed that many uses of is_really_empty_class
were overlooking that it returned true for a class with only a vptr;
initialization of such a class is not trivial.  Marek's P1064 patch fixed
one place in constexpr.c to also check for a vtable, but there are several
others that still don't.

This patch requires callers to explicitly choose which behavior they want.
Currently the uses in constexpr.c want to consider the vptr, and other uses
don't.

* class.c (is_really_empty_class): Add ignore_vptr parm.
(trivial_default_constructor_is_constexpr): Pass it.
* call.c (build_over_call): Pass it.
* constexpr.c (cxx_eval_constant_expression): Pass it instead of
checking TYPE_POLYMORPHIC_P.
(cxx_eval_component_reference, potential_constant_expression_1):
Pass it.
* cp-gimplify.c (simple_empty_class_p): Pass it.
* init.c (expand_aggr_init_1): Pass it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@269402 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/class.c
gcc/cp/constexpr.c
gcc/cp/cp-gimplify.c
gcc/cp/cp-tree.h
gcc/cp/init.c