Skip to content

Commit 81499c5

Browse files
committed
Small fixes based on review
will be squashed.
1 parent a41a250 commit 81499c5

File tree

12 files changed

+32
-32
lines changed

12 files changed

+32
-32
lines changed

regression/cbmc/incomplete-sizeof-enum/test.desc

Lines changed: 0 additions & 9 deletions
This file was deleted.

regression/cbmc/incomplete-sizeof-struct/test.desc

Lines changed: 0 additions & 9 deletions
This file was deleted.

regression/cbmc/incomplete-sizeof-union/test.desc

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
array.c
3+
4+
^EXIT=6$
5+
^SIGNAL=0$
6+
^file array.c line \d+ function main: invalid application of \'sizeof\' to an incomplete type$
7+
^CONVERSION ERROR$
8+
--
9+
^warning: ignoring
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
CORE
2-
main.c
2+
enum.c
33

44
^EXIT=6$
55
^SIGNAL=0$
6-
^file main.c line \d+ function main: invalid application of \'sizeof\' to an incomplete type$
6+
^file enum.c line \d+ function main: invalid application of \'sizeof\' to an incomplete type$
77
^CONVERSION ERROR$
88
--
99
^warning: ignoring
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
struct.c
3+
4+
^EXIT=6$
5+
^SIGNAL=0$
6+
^file struct.c line \d+ function main: invalid application of \'sizeof\' to an incomplete type$
7+
^CONVERSION ERROR$
8+
--
9+
^warning: ignoring
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
union.c
3+
4+
^EXIT=6$
5+
^SIGNAL=0$
6+
^file union.c line \d+ function main: invalid application of \'sizeof\' to an incomplete type$
7+
^CONVERSION ERROR$
8+
--
9+
^warning: ignoring

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,11 +953,11 @@ void c_typecheck_baset::typecheck_expr_sizeof(exprt &expr)
953953
{
954954
if(
955955
(type.id() == ID_struct_tag &&
956-
to_struct_type(follow_tag(to_struct_tag_type(type))).is_incomplete()) ||
956+
follow_tag(to_struct_tag_type(type)).is_incomplete()) ||
957957
(type.id() == ID_union_tag &&
958-
to_union_type(follow_tag(to_union_tag_type(type))).is_incomplete()) ||
958+
follow_tag(to_union_tag_type(type)).is_incomplete()) ||
959959
(type.id() == ID_c_enum_tag &&
960-
to_c_enum_type(follow_tag(to_c_enum_tag_type(type))).is_incomplete()) ||
960+
follow_tag(to_c_enum_tag_type(type)).is_incomplete()) ||
961961
(type.id() == ID_array && to_array_type(type).is_incomplete()))
962962
{
963963
error().source_location = expr.source_location();

0 commit comments

Comments
 (0)