[C++ Patch] PR 33459

Mark Mitchell mark@codesourcery.com
Thu Sep 20 07:37:00 GMT 2007


Paolo Carlini wrote:

> I have this tiny tentative patch, my analysis follows. Since the patch
> for c++/32245, we are using build_zero_init for the present kind of
> snippet. In general, for a CLASS_TYPE_P, it recursively calls  itself
> for all the fields, and the return values are appended to a VEC that
> hosts all the initializations. In the case of this PR, we have
> TREE_CODE(type) == REFERENCE_TYPE at the first recursion, and a
> NULL_TREE is returned, meaning, correctly for a reference (per
> [dcl.init]), no initialization.

This patch is OK.

Let's please also document the NULL_TREE return case.  In particular:

..., or a CONSTRUCTOR (in the case that T is an aggregate), or NULL (in
the case that T does not require initialization).

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list