Skip to content

Address-of compound literal expression fails  #859

Closed
@john-h-kastner

Description

@john-h-kastner
struct a {  int a; };
_Ptr<struct a> a0 =  &(struct a){0};

Compiling with clang -c gives

struct.c:5:22: error: expression has unknown bounds, cast to ptr<T> expects source to have bounds
_Ptr<struct a> a0 =  &(struct a){0};
                     ^~~~~~~~~~~~~~
1 error generated.

The same result is seen for array compound literals

_Ptr<int[1]> a1 = &(int[1]){0};
arr.c:1:19: error: expression has unknown bounds, cast to ptr<T> expects source to have bounds
_Ptr<int[1]> a1 = &(int[1]){0};
                  ^~~~~~~~~~~~
1 error generated.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions