Branch: Tag:

2018-09-10

2018-09-10 10:39:15 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [Compat]: static_assert() is now valid in expressions again.

As static_assert() is valid in expressions in Pike 8.0, it should
be that in Pike 8.1 too for compatibility reasons.

This also makes it possible to use static_assert() in Hilfe.

FIXME: Consider warning about such use?

1021:    | modifiers named_class { free_node($2); }    | modifiers enum { free_node($2); }    | typedef {} -  | static_assertion {} +  | static_assertion expected_semicolon {}    | error TOK_LEX_EOF    {    reset_type_stack();
1053:    }    ;    - static_assertion: TOK_STATIC_ASSERT '(' expr0 ',' expr0 ')' expected_semicolon + static_assertion: TOK_STATIC_ASSERT '(' expr0 ',' expr0 ')'    {    Pike_compiler->init_node =    mknode(F_COMMA_EXPR, Pike_compiler->init_node,
1942:    ;      statement_with_semicolon: unused2 expected_semicolon -  | static_assertion { $$ = 0; } +     ;      normal_label_statement: statement_with_semicolon
3646:    | gauge    | typeof    | sscanf +  | static_assertion { $$ = mknewintnode(0); }    | lambda    | implicit_modifiers anon_class { $$ = $2; }    | implicit_modifiers enum { $$ = $2; }