[C++ PATCH] PR21210: Default construction of complex types
Mark Mitchell
mark@codesourcery.com
Mon Jun 12 16:52:00 GMT 2006
Roger Sayle wrote:
> 2006-06-07 Roger Sayle <roger@eyesopen.com>
>
> PR c++/21210
> * typeck2.c (build_functional_cast): Use cp_convert to construct
> non-aggregate initializers instead of the user-level build_c_cast.
>
> * g++.dg/init/complex1.C: New test case.
In the abstract, I don't think we should use cp_convert here -- but,
then again, we shouldn't really use build_c_cast either. We should use
some low-level routine which just assembles the right thing, without
doing any semantic checking -- both to avoid any possible error
messages, and to save the expense of checking for errors we know cannot
be there.
However, that's all in the abstract; I think the current patch is
definitely an improvement (fixes a bug!), and I'm not sure there's an
easy way to do the abstractly more right thing, so this patch is OK.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
More information about the Gcc-patches
mailing list