Skip to content

Commit 1d7373c

Browse files
committed
Add missing #include <cassert>
cassert is implicitly provided via nonstd/optional, but this will change with the move to std::optional. The even better fix would be the replacement of all uses of assert(...) in these files, but this is a larger endeavour.
1 parent 629d029 commit 1d7373c

21 files changed

+32
-0
lines changed

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Author: Daniel Kroening, [email protected]
1111

1212
#include "c_typecheck_base.h"
1313

14+
#include <cassert>
1415
#include <sstream>
1516

1617
#include <util/arith_tools.h>

src/ansi-c/c_typecheck_initializer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Author: Daniel Kroening, [email protected]
2323
#include "c_typecheck_base.h"
2424
#include "type2name.h"
2525

26+
#include <cassert>
27+
2628
void c_typecheck_baset::do_initializer(
2729
exprt &initializer,
2830
const typet &type,

src/ansi-c/c_typecheck_type.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Author: Daniel Kroening, [email protected]
1111

1212
#include "c_typecheck_base.h"
1313

14+
#include <cassert>
1415
#include <unordered_set>
1516

1617
#include <goto-programs/goto_instruction_code.h>

src/cpp/cpp_instantiate_template.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Author: Daniel Kroening, [email protected]
1515
#include <iostream>
1616
#endif
1717

18+
#include <cassert>
19+
1820
#include <util/arith_tools.h>
1921
#include <util/base_exceptions.h>
2022

src/cpp/cpp_typecheck.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Author: Daniel Kroening, [email protected]
1212
#include "cpp_typecheck.h"
1313

1414
#include <algorithm>
15+
#include <cassert>
1516

1617
#include <util/pointer_expr.h>
1718
#include <util/source_location.h>

src/cpp/cpp_typecheck_code.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Author: Daniel Kroening, [email protected]
2121
#include "cpp_typecheck_fargs.h"
2222
#include "cpp_util.h"
2323

24+
#include <cassert>
25+
2426
void cpp_typecheckt::typecheck_code(codet &code)
2527
{
2628
const irep_idt &statement=code.get_statement();

src/cpp/cpp_typecheck_compound_type.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Author: Daniel Kroening, [email protected]
1616
#endif
1717

1818
#include <algorithm>
19+
#include <cassert>
1920

2021
#include <util/arith_tools.h>
2122
#include <util/std_types.h>

src/cpp/cpp_typecheck_constructor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Author: Daniel Kroening, [email protected]
1818
#include <util/pointer_expr.h>
1919
#include <util/std_code.h>
2020

21+
#include <cassert>
22+
2123
/// Generate code to copy the parent.
2224
/// \param source_location: location for generated code
2325
/// \param parent_base_name: base name of typechecked parent

src/cpp/cpp_typecheck_conversions.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Module: C++ Language Type Checking
2323

2424
#include "cpp_util.h"
2525

26+
#include <cassert>
27+
2628
/// Lvalue-to-rvalue conversion
2729
///
2830
/// An lvalue (3.10) of a non-function, non-array type T can be

src/cpp/cpp_typecheck_expr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Author: Daniel Kroening, [email protected]
1515
#include <iostream>
1616
#endif
1717

18+
#include <cassert>
19+
1820
#include <util/arith_tools.h>
1921
#include <util/c_types.h>
2022
#include <util/config.h>

src/cpp/cpp_typecheck_resolve.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Author: Daniel Kroening, [email protected]
1616
#endif
1717

1818
#include <algorithm>
19+
#include <cassert>
1920

2021
#include <util/arith_tools.h>
2122
#include <util/c_types.h>

src/cpp/cpp_typecheck_template.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Author: Daniel Kroening, [email protected]
2020
#include "cpp_convert_type.h"
2121
#include "cpp_template_args.h"
2222

23+
#include <cassert>
24+
2325
void cpp_typecheckt::salvage_default_arguments(
2426
const template_typet &old_type,
2527
template_typet &new_type)

src/cpp/cpp_typecheck_type.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Author: Daniel Kroening, [email protected]
2020
#include "cpp_convert_type.h"
2121
#include "cpp_typecheck_fargs.h"
2222

23+
#include <cassert>
24+
2325
void cpp_typecheckt::typecheck_type(typet &type)
2426
{
2527
assert(!type.id().empty());

src/cpp/parse.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Author: Daniel Kroening, [email protected]
1111

1212
#include "cpp_parser.h"
1313

14+
#include <cassert>
1415
#include <map>
1516

1617
#include <util/c_types.h>

src/goto-diff/change_impact.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Date: April 2016
1313

1414
#include "change_impact.h"
1515

16+
#include <cassert>
1617
#include <iostream>
1718

1819
#include <goto-programs/goto_model.h>

src/goto-instrument/goto_program2code.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Author: Daniel Kroening, [email protected]
1111

1212
#include "goto_program2code.h"
1313

14+
#include <cassert>
1415
#include <sstream>
1516

1617
#include <util/arith_tools.h>

src/goto-instrument/k_induction.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Author: Daniel Kroening, [email protected]
2020
#include "loop_utils.h"
2121
#include "unwind.h"
2222

23+
#include <cassert>
24+
2325
class k_inductiont
2426
{
2527
public:

src/goto-instrument/unwind.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Author: Daniel Kroening, [email protected]
1616
#include <iostream>
1717
#endif
1818

19+
#include <cassert>
20+
1921
#include <util/expr_util.h>
2022
#include <util/std_expr.h>
2123

src/goto-instrument/wmm/cycle_collection.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Date: 2012
1515

1616
#include <util/message.h>
1717

18+
#include <cassert>
19+
1820
/// after the collection, eliminates the executions forbidden by an indirect
1921
/// thin-air
2022
void event_grapht::graph_explorert::filter_thin_air(

src/goto-instrument/wmm/event_graph.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Date: 2012
1515

1616
#include <util/message.h>
1717

18+
#include <cassert>
1819
#include <fstream>
1920

2021

src/goto-instrument/wmm/goto2graph.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Date: 2012
1313

1414
#include "goto2graph.h"
1515

16+
#include <cassert>
1617
#include <vector>
1718
#include <string>
1819
#include <fstream>

0 commit comments

Comments
 (0)