Skip to content

Commit f92083d

Browse files
author
Daniel Kroening
committed
remove array_typet() constructor, which produces an incomplete object
1 parent 72f63f3 commit f92083d

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

src/cpp/parse.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -5987,9 +5987,7 @@ bool Parser::rNewDeclarator(typet &decl)
59875987
if(lex.get_token(cb)!=']')
59885988
return false;
59895989

5990-
array_typet array_type;
5991-
array_type.size().swap(expr);
5992-
array_type.subtype().swap(decl);
5990+
array_typet array_type(decl, expr);
59935991
set_location(array_type, ob);
59945992

59955993
decl.swap(array_type);

src/goto-programs/string_instrumentation.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -791,9 +791,7 @@ void string_instrumentationt::do_strerror(
791791
new_symbol_size.is_lvalue=true;
792792
new_symbol_size.is_static_lifetime=true;
793793

794-
array_typet type;
795-
type.subtype()=char_type();
796-
type.size()=new_symbol_size.symbol_expr();
794+
array_typet type(char_type(), new_symbol_size.symbol_expr());
797795
symbolt new_symbol_buf;
798796
new_symbol_buf.mode=ID_C;
799797
new_symbol_buf.type=type;

src/util/std_types.h

-4
Original file line numberDiff line numberDiff line change
@@ -972,10 +972,6 @@ inline code_typet &to_code_type(typet &type)
972972
class array_typet:public type_with_subtypet
973973
{
974974
public:
975-
array_typet():type_with_subtypet(ID_array)
976-
{
977-
}
978-
979975
array_typet(
980976
const typet &_subtype,
981977
const exprt &_size):type_with_subtypet(ID_array, _subtype)

0 commit comments

Comments
 (0)