mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
@tag didn't work with members #2236.
This commit is contained in:
@@ -61,7 +61,8 @@
|
||||
- Overload resolution fixes to inline typedef #2226.
|
||||
- `math::overflow_*` wrappers incorrectly don't allow distinct integers #2221.
|
||||
- Compiler segfault when using distinct type in attribute imported from other module #2234.
|
||||
- Assert casting bitstruct to short/char #2237
|
||||
- Assert casting bitstruct to short/char #2237.
|
||||
- @tag didn't work with members #2236.
|
||||
|
||||
### Stdlib changes
|
||||
- Deprecate `String.is_zstr` and `String.quick_zstr` #2188.
|
||||
|
||||
@@ -3594,6 +3594,7 @@ static bool sema_analyse_attributes_inner(SemaContext *context, ResolvedAttrData
|
||||
static bool sema_analyse_attributes(SemaContext *context, Decl *decl, Attr **attrs, AttributeDomain domain,
|
||||
bool *erase_decl)
|
||||
{
|
||||
if (decl->resolved_attributes) return true;
|
||||
ResolvedAttrData data = { .tags = NULL, .overload = INVALID_SPAN };
|
||||
if (!sema_analyse_attributes_inner(context, &data, decl, attrs, domain, NULL, erase_decl)) return false;
|
||||
if (*erase_decl) return true;
|
||||
|
||||
13
test/test_suite/union/member_tag.c3
Normal file
13
test/test_suite/union/member_tag.c3
Normal file
@@ -0,0 +1,13 @@
|
||||
struct Test
|
||||
{
|
||||
union a @tag("a", 1)
|
||||
{
|
||||
int x;
|
||||
}
|
||||
}
|
||||
|
||||
fn int main(String[] args)
|
||||
{
|
||||
$assert(Test.a.has_tagof("a")); // Error: Compile time assert failed.
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user