On Monday, May 14, 2012 23:59:19 Timon Gehr wrote:
> On 05/13/2012 06:13 PM, Alex Rønne Petersen wrote:
> > Hi,
> > 
> > If memory serves me right, there were some proposals in the past to add
> > a @noreturn attribute to the language. Where did this go?
> > 
> > In writing unwinding mechanisms for my VM, I find myself actually
> > needing some sort of @noreturn function attribute that would tell the
> > compiler that the function does not return, rather than having to insert
> > an assert(false); statement.
> 
> What about making the compiler detect this pattern instead of adding an
> attribute? I think it expresses exactly what you want to express, and it
> does not require additional syntax.
> 
> void foo()out{ assert(false); }body{ ... }

That would only work with templates for the same reasons that attribute 
inference in general only work with templates. You need the body to do the 
inference, and if the function is not a template, you're not guranteed to have 
the body.

- Jonathan M Davis

Reply via email to