[C++ PATCH] Reject calls to function with incomplete arguments (PR c++/33501)
Mark Mitchell
mark@codesourcery.com
Wed Nov 7 01:50:00 GMT 2007
Jakub Jelinek wrote:
> 2007-11-06 Jakub Jelinek <jakub@redhat.com>
>
> PR c++/33501
> * call.c (build_over_call): Don't check TREE_ADDRESSABLE
> on incomplete type.
>
> * g++.dg/warn/incomplete2.C: New test.
> * g++.dg/template/incomplete4.C: New test.
> * g++.dg/template/incomplete5.C: New test.
This is probably OK, but it seems a bit hokey to me, in the sense that,
by the time of a call, we need all of the arguments to be complete. Period.
So, maybe we should move the completeness check to resolve_args? At
that point, if !COMPLETE_TYPE_P (complete_type (TREE_TYPE (arg)), issue
an error, and return error_mark_node. That would get these invalid
arguments out of the way sooner. Does that work?
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
More information about the Gcc-patches
mailing list