diff options
author | Michael Forney <mforney@mforney.org> | 2022-08-05 12:43:48 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2022-08-05 12:43:48 -0700 |
commit | 6fabc79d81de56b6c1cdcc2242933fd792e2ddf9 (patch) | |
tree | 4e7b357ff9f1703ae452034fa7161b9da432f4c7 /test/initializer-member-static.c | |
parent | dc7e08ca0aaa21b9f62944e237f3fa068b40106f (diff) |
expr: Fix constant evaluation of struct member address
fb00ba6978 had the side-effect of introducing an integer to pointer
cast, which was not evaluated as a constant expression. To fix this,
just set the type of the expression.
Diffstat (limited to 'test/initializer-member-static.c')
-rw-r--r-- | test/initializer-member-static.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/initializer-member-static.c b/test/initializer-member-static.c new file mode 100644 index 0000000..7433a33 --- /dev/null +++ b/test/initializer-member-static.c @@ -0,0 +1,2 @@ +extern struct { int x; } s; +int *p = &s.x; |