summaryrefslogtreecommitdiff
path: root/gcc/cp/cvt.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-04 03:28:53 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-04 03:28:53 +0000
commit930e81755b53deb8ef27e5531d87d33be3c59d3b (patch)
tree985387257ec096f981de1673a4abb0deacefe8d7 /gcc/cp/cvt.c
parentc55906ebc040e0fb9e0d44be38b343068e6bbc1d (diff)
downloadgcc-930e81755b53deb8ef27e5531d87d33be3c59d3b.tar.gz
PR c++/33916
* cp/init.c (build_value_init_1): New function. (build_value_init): New function. * cp/typeck2.c (build_functional_cast): Call it. * cp/cp-gimplify.c (cp_gimplify_init_expr): Handle its output. * cp/cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from TYPE_HAS_CONSTRUCTOR. * cp/class.c (finish_struct_bits, maybe_warn_about_overly_private_class, add_implicitly_declared_members): Adjust. (check_field_decls): Adjust. Remove warnings about reference/const in class without constructor. (check_bases_and_members): Adjust. Give those warnings here instead. * cp/decl.c (fixup_anonymous_aggr): Adjust. (check_initializer): Adjust, clarify logic slightly. (grok_special_member_properties): Adjust, only set if user-provided. * cp/rtti.c (create_tinfo_types): Don't set. * cp/cvt.c (ocp_convert): Remove exception for vtable_entry_type et al. Use same_type_ignoring_top_level_qualifiers_p. * cp/pt.c (check_explicit_specialization): Adjust. (instantiate_class_template): Adjust. * print-tree.c (print_node) [CONSTRUCTOR]: Print elements. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132088 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r--gcc/cp/cvt.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index ebfc7d05d98..5f48cc525e8 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -596,13 +596,9 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
e = integral_constant_value (e);
- if (IS_AGGR_TYPE (type) && (convtype & CONV_FORCE_TEMP)
- /* Some internal structures (vtable_entry_type, sigtbl_ptr_type)
- don't go through finish_struct, so they don't have the synthesized
- constructors. So don't force a temporary. */
- && TYPE_HAS_CONSTRUCTOR (type))
+ if (IS_AGGR_TYPE (type) && (convtype & CONV_FORCE_TEMP))
/* We need a new temporary; don't take this shortcut. */;
- else if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (e)))
+ else if (same_type_ignoring_top_level_qualifiers_p (type, TREE_TYPE (e)))
{
if (same_type_p (type, TREE_TYPE (e)))
/* The call to fold will not always remove the NOP_EXPR as
@@ -619,10 +615,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
else if (TREE_CODE (e) == TARGET_EXPR)
{
/* Don't build a NOP_EXPR of class type. Instead, change the
- type of the temporary. Only allow this for cv-qual changes,
- though. */
- gcc_assert (same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (e)),
- TYPE_MAIN_VARIANT (type)));
+ type of the temporary. */
TREE_TYPE (e) = TREE_TYPE (TARGET_EXPR_SLOT (e)) = type;
return e;
}