CVS head (gcc-3.4), new warning for 'no return in templates'

Mark Mitchell mark@codesourcery.com
Tue Dec 31 11:53:00 GMT 2002



--On Tuesday, December 31, 2002 11:44:55 AM +0000 Andrew Pollard 
<andrewp@andypo.net> wrote:

>
> Hi All,
>
>  The following was 'recently' committed....
>
>> 2002-12-17  Jason Merrill  <jason@redhat.com>
>>
>>    * decl.c (finish_function): Also complain about no return in
>>    templates.
>>    * semantics.c (finish_return_stmt): Also call check_return_expr in
>>    templates.
>>    * typeck.c (check_return_expr): In a template, just remember that we
>>    saw a return.
>
> Which in itself is probably a good change, but I've just noticed (from
> the Apache Xalan library), that it causes a warning in the following
> case...

I meant to comment on this patch when I saw it go by -- I think it's a
mistake.  I think it makes little sense to warn about much of anything
in templates due to problems like these; at the very least, we should
only be warning when the return type is non-dependent.

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com



More information about the Gcc mailing list