On Wed, 10 May 2006, Andreas Schwab wrote:

> Mike Stump <[EMAIL PROTECTED]> writes:
> 
> > Speaking of typeof, should typeof (vla) follow the same rules as for
> > sizeof (vla)?  vla, evaluate, otherwise, no eval.
> 
> How would typeof be able to eval anything?

If you have "typeof ((int (*)[f()])g())", clearly you need to evaluate the 
call f() in order to know the type being referred to.  As such, I think 
the logical conclusion is to evaluate the argument of typeof whenever of 
VM type (and so evaluate the call g() as well).

With VLAs, type names (in declarations, sizeof, typeof, casts and compound 
literals) can need to be executed for their side-effects.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    [EMAIL PROTECTED] (personal mail)
    [EMAIL PROTECTED] (CodeSourcery mail)
    [EMAIL PROTECTED] (Bugzilla assignments and CCs)

Reply via email to