Skip to content

Commit 6164ac7

Browse files
committed
Do not use c_qualifiers on goto-program expressions
goto-programs are not C specific.
1 parent 7716f3f commit 6164ac7

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/goto-programs/remove_const_function_pointers.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ Author: Thomas Kiley, [email protected]
1616
#include <util/std_expr.h>
1717
#include <util/symbol_table.h>
1818

19-
#include <ansi-c/c_qualifiers.h>
20-
2119
#include "goto_functions.h"
2220

2321
#define LOG(message, irep) \
@@ -786,16 +784,10 @@ bool remove_const_function_pointerst::is_const_expression(
786784
/// arrays are implicitly const in C.
787785
bool remove_const_function_pointerst::is_const_type(const typet &type) const
788786
{
789-
c_qualifierst qualifers(type);
790-
if(type.id()==ID_array)
791-
{
792-
c_qualifierst array_type_qualifers(type.subtype());
793-
return qualifers.is_constant || array_type_qualifers.is_constant;
794-
}
795-
else
796-
{
797-
return qualifers.is_constant;
798-
}
787+
if(type.id() == ID_array && type.subtype().get_bool(ID_C_constant))
788+
return true;
789+
790+
return type.get_bool(ID_C_constant);
799791
}
800792

801793
/// To extract the value of the specific component within a struct

0 commit comments

Comments
 (0)