Skip to content

Add support for cast expressions to the constant expression interpreter #573

@robertoraggi

Description

@robertoraggi
struct X {
  int x[(int)1];
};

static_assert(sizeof(struct X) == 4);
$ cxx -fcheck x.c 
x.c:2:8: error: alignment of incomplete type 'int x[(int)1]'
struct X {
       ^
x.c:6:1: error: static assert failed
static_assert(sizeof(struct X) == 4);
^

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions