mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- attrdef with any invalid name causes compiler assert #2128.
This commit is contained in:
@@ -10,8 +10,9 @@
|
||||
- Assert triggered when casting from `int[2]` to `uint[2]` #2115
|
||||
- Assert when a macro with compile time value is discarded, e.g. `foo();` where `foo()` returns an untyped list. #2117
|
||||
- Fix stringify for compound initializers #2120.
|
||||
- Fix No index OOB check for `[:^n]` #2123
|
||||
- Fix regression in Time diff due to operator overloading #2124
|
||||
- Fix No index OOB check for `[:^n]` #2123.
|
||||
- Fix regression in Time diff due to operator overloading #2124.
|
||||
- attrdef with any invalid name causes compiler assert #2128.
|
||||
|
||||
### Stdlib changes
|
||||
- Added `String.quick_ztr` and `String.is_zstr`
|
||||
|
||||
@@ -2209,7 +2209,7 @@ static inline Decl *parse_attrdef(ParseContext *c)
|
||||
|
||||
Decl *decl = decl_new(DECL_ATTRIBUTE, symstr(c), c->span);
|
||||
|
||||
advance_and_verify(c, TOKEN_AT_TYPE_IDENT);
|
||||
TRY_CONSUME_OR_RET(TOKEN_AT_TYPE_IDENT, "Expected an attribute type name, like '@MyAttr'.", poisoned_decl);
|
||||
|
||||
if (try_consume(c, TOKEN_LPAREN))
|
||||
{
|
||||
|
||||
9
test/test_suite/attributes/illegal_attr.c3
Normal file
9
test/test_suite/attributes/illegal_attr.c3
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
attrdef @FOO = @test; // #error: Expected an
|
||||
attrdef 1 = @test; // #error: Expected an
|
||||
attrdef @foo = @test; // #error: Expected an
|
||||
attrdef foo = @test; // #error: Expected an
|
||||
attrdef $foo = @test; // #error: Expected an
|
||||
attrdef #foo = @test; // #error: Expected an
|
||||
attrdef "foo" = @test; // #error: Expected an
|
||||
attrdef 'f' = @test; // #error: Expected an
|
||||
Reference in New Issue
Block a user