aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2007-07-06 01:23:54 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2007-07-06 01:23:54 +0000
commit32a11c08863764dfd6a3be749c0729fee6cd298c (patch)
tree17dc867104325855fe255d6858ff0978e0b8936c /gcc/cp/init.c
parent22761ec3b9b4688e515019b6b97025fda5be6a44 (diff)
downloadgcc-32a11c08863764dfd6a3be749c0729fee6cd298c.zip
gcc-32a11c08863764dfd6a3be749c0729fee6cd298c.tar.gz
gcc-32a11c08863764dfd6a3be749c0729fee6cd298c.tar.bz2
re PR c++/32245 (wrong POD type initialization with pointer to member)
PR c++/32245 * init.c (build_zero_init): Always build an initializer for non-static storage. * typeck2.c (build_functional_cast): Use build_zero_init. PR c++/32251 * init.c (build_new_1): Always pass the allocation function to build_op_delete_call. * call.c (build_op_delete_call): Handle operator delete with a variable-argument list. Do not issue an error when no matching deallocation function is available for a new operator. PR c++/31992 * cp-tree.h (any_value_dependent_elements_p): Declare it. * decl.c (value_dependent_init_p): New function. (cp_finish_decl): Use it. * pt.c (value_dependent_expression_p): Use any_value_dependent_elements_p. * parser.c (cp_parser_primary_expression): Add comment about treating dependent qualified names as integral constant-expressions. PR c++/32245 * g++.dg/init/ptrmem4.C: New test. PR c++/32251 * g++.dg/init/new21.C: Likewise. PR c++/31992 * g++.dg/template/static30.C: Likewise. From-SVN: r126399
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index b000cfd..288d0fa 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -196,7 +196,7 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
corresponding to base classes as well. Thus, iterating
over TYPE_FIELDs will result in correct initialization of
all of the subobjects. */
- if (static_storage_p && !zero_init_p (TREE_TYPE (field)))
+ if (!static_storage_p || !zero_init_p (TREE_TYPE (field)))
{
tree value = build_zero_init (TREE_TYPE (field),
/*nelts=*/NULL_TREE,
@@ -2038,8 +2038,7 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
globally_qualified_p,
(placement_allocation_fn_p
? alloc_call : NULL_TREE),
- (placement_allocation_fn_p
- ? alloc_fn : NULL_TREE));
+ alloc_fn);
if (!cleanup)
/* We're done. */;