[C++ PATCH] C++0x static assertions

Mark Mitchell mark@codesourcery.com
Mon Nov 13 02:13:00 GMT 2006


Gabriel Dos Reis wrote:
> Mark Mitchell <mark@codesourcery.com> writes:
> 
> [...]
> 
> | and they don't have many of the normal declaration properties.  For
> | example, they don't have names -- which is perhaps *the* fundamental
> | property of a declaration.  So, I would create a tcc_exceptional node
> | for these. 
> 
> Indeed.  I pointed out that irregularity four years ago, but the
> committee didn't not think it was disturbing enough, just like
> asm-declarations :-(
> 
> Would an expression node be a better choice?

You can't use them as expressions, as I understand it.  For example:

  f(static_assert<true, "false?!?">)

is invalid.  So, I think it's best to make them exceptional.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list