Skip to content

Commit

Permalink
don't use default == operator to avoid compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
xtofalex committed Mar 14, 2024
1 parent 3d4513b commit e0a15ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/VerilogTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ struct Range {
valid_(true), singleValue_(false), msb_(msb), lsb_(lsb) {}
Range(int value):
valid_(true), singleValue_(true), msb_(value) {}
bool operator==(const Range& other) const = default;
bool operator==(const Range& other) const {
return valid_ == other.valid_
&& singleValue_ == other.singleValue_
&& msb_ == other.msb_
&& lsb_ == other.lsb_;
}

std::string getString() const;

Expand All @@ -34,7 +39,9 @@ struct Identifier {
Identifier() = default;
Identifier(const Identifier&) = default;
Identifier(const std::string& name, bool escaped=false): name_(name), escaped_(escaped) {}
bool operator==(const Identifier& other) const = default;
bool operator==(const Identifier& other) const {
return name_ == other.name_ && escaped_ == other.escaped_;
}
std::string getString() const;
std::string getDescription() const;

Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ add_executable(naja_verilog_tests ${tests})
target_compile_definitions(naja_verilog_tests PRIVATE
NAJA_VERILOG_BENCHMARKS="${CMAKE_CURRENT_SOURCE_DIR}")

target_link_libraries(naja_verilog_tests naja_verilog gtest gmock gtest_main)
target_link_libraries(naja_verilog_tests naja_verilog gmock gtest_main)

GTEST_DISCOVER_TESTS(naja_verilog_tests)

0 comments on commit e0a15ca

Please sign in to comment.