Skip to content

Commit a8e659c

Browse files
committed
Fixed CMake linker ODR violations caused by a regression-test
Including .Cpp file in a regression-test was causing linker issues with CMake, specifically ODR (One Definition Rule) violations. Commit addresses this by modifying the test to include the header file instead.
1 parent f66288b commit a8e659c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/java_bytecode/java_types.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ std::vector<typet> parse_list_types(
2929
const char opening_bracket,
3030
const char closing_bracket);
3131

32-
size_t find_closing_semi_colon_for_reference_type(
33-
const std::string src,
34-
size_t starting_point = 0);
35-
3632
typet java_int_type()
3733
{
3834
return signedbv_typet(32);

src/java_bytecode/java_types.h

+4
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ std::vector<typet> java_generic_type_from_string(
8282

8383
typet java_bytecode_promotion(const typet &);
8484
exprt java_bytecode_promotion(const exprt &);
85+
size_t find_closing_semi_colon_for_reference_type(
86+
const std::string src,
87+
size_t starting_point = 0);
88+
8589

8690
bool is_java_array_tag(const irep_idt &tag);
8791
bool is_valid_java_array(const struct_typet &);

unit/java_bytecode/java_utils_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include <testing-utils/catch.hpp>
1515

16-
#include <java_bytecode/java_types.cpp>
16+
#include <java_bytecode/java_types.h>
1717
#include <java_bytecode/java_utils.h>
1818

1919
SCENARIO("Test that the generic signature delimiter lookup works reliably",

0 commit comments

Comments
 (0)