From: hjl Date: Sat, 1 May 2010 13:52:52 +0000 (+0000) Subject: Revert the accidental checkin in revision 158918. X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=ee190922a1ff11474b3b3131e3da5cddb45f0a61 Revert the accidental checkin in revision 158918. gcc/cp/ 2010-05-01 H.J. Lu PR c++/43951 * init.c (build_new_1): Revert the accidental checkin in revision 158918. gcc/testsuite/ 2010-05-01 H.J. Lu PR c++/43951 * g++.dg/init/new28.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158959 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1818d0cd889..51559e8aee6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2010-05-01 H.J. Lu + + PR c++/43951 + * init.c (build_new_1): Revert the accidental checkin in + revision 158918. + 2010-04-30 Jason Merrill PR c++/43868 diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 70e3d387e9e..4fc90e6c276 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1911,13 +1911,13 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts, is_initialized = (TYPE_NEEDS_CONSTRUCTING (elt_type) || *init != NULL); - if (*init == NULL) + if (*init == NULL && !type_has_user_provided_constructor (elt_type)) { - bool maybe_uninitialized_error = false; + bool uninitialized_error = false; /* A program that calls for default-initialization [...] of an entity of reference type is ill-formed. */ if (CLASSTYPE_REF_FIELDS_NEED_INIT (elt_type)) - maybe_uninitialized_error = true; + uninitialized_error = true; /* A new-expression that creates an object of type T initializes that object as follows: @@ -1932,9 +1932,9 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts, const-qualified type, the program is ill-formed; */ if (CLASSTYPE_READONLY_FIELDS_NEED_INIT (elt_type)) - maybe_uninitialized_error = true; + uninitialized_error = true; - if (maybe_uninitialized_error) + if (uninitialized_error) { if (complain & tf_error) diagnose_uninitialized_cst_or_ref_member (elt_type, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4ef7a6fb11d..8e1b484794c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-05-01 H.J. Lu + + PR c++/43951 + * g++.dg/init/new28.C: New. + 2010-04-30 Iain Sandoe PR objc++/32052