diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index 54a782c6e..107108c9e 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -66,11 +66,6 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA add_compile_options($<$:-Wextra-semi>) endif() # TODO: This is a temporary workaround. The underlying warning should be addressed and this workaround removed ASAP. - check_cxx_compiler_flag(-Wno-error=overloaded-virtual=1 WNO_ERROR_OVERLOADED_VIRTUAL) - if (WNO_ERROR_OVERLOADED_VIRTUAL) - add_compile_options($<$:-Wno-error=overloaded-virtual=1>) - endif() - # TODO: This is a temporary workaround. The underlying warning should be addressed and this workaround removed ASAP. # Once https://github.com/fmtlib/fmt/issues/3415 is addressed, this can be fixed by bumping the fmtlib version. check_cxx_compiler_flag(-Wno-error=dangling-reference WNO_ERROR_DANGLING_REFERENCE) if (WNO_ERROR_DANGLING_REFERENCE) diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 1218baee3..6308dbe3d 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -1694,7 +1694,7 @@ bool ArrayType::operator==(Type const& _other) const return false; ArrayType const& other = dynamic_cast(_other); if ( - !ReferenceType::operator==(other) || + !equals(other) || other.isByteArray() != isByteArray() || other.isString() != isString() || other.isDynamicallySized() != isDynamicallySized() @@ -2204,7 +2204,7 @@ bool StructType::operator==(Type const& _other) const if (_other.category() != category()) return false; StructType const& other = dynamic_cast(_other); - return ReferenceType::operator==(other) && other.m_struct == m_struct; + return equals(other) && other.m_struct == m_struct; } diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h index fa1a299a9..1fc0a7e17 100644 --- a/libsolidity/ast/Types.h +++ b/libsolidity/ast/Types.h @@ -803,7 +803,7 @@ public: /// if the type has an interfaceType. virtual BoolResult validForLocation(DataLocation _loc) const = 0; - bool operator==(ReferenceType const& _other) const + bool equals(ReferenceType const& _other) const { return location() == _other.location() && isPointer() == _other.isPointer(); } diff --git a/libsolidity/codegen/YulUtilFunctions.cpp b/libsolidity/codegen/YulUtilFunctions.cpp index fa5573810..db020fc67 100644 --- a/libsolidity/codegen/YulUtilFunctions.cpp +++ b/libsolidity/codegen/YulUtilFunctions.cpp @@ -1833,7 +1833,7 @@ string YulUtilFunctions::clearStorageStructFunction(StructType const& _type) string YulUtilFunctions::copyArrayToStorageFunction(ArrayType const& _fromType, ArrayType const& _toType) { solAssert( - *_fromType.copyForLocation(_toType.location(), _toType.isPointer()) == dynamic_cast(_toType), + (*_fromType.copyForLocation(_toType.location(), _toType.isPointer())).equals(dynamic_cast(_toType)), "" ); if (!_toType.isDynamicallySized()) @@ -1930,7 +1930,7 @@ string YulUtilFunctions::copyArrayToStorageFunction(ArrayType const& _fromType, string YulUtilFunctions::copyByteArrayToStorageFunction(ArrayType const& _fromType, ArrayType const& _toType) { solAssert( - *_fromType.copyForLocation(_toType.location(), _toType.isPointer()) == dynamic_cast(_toType), + (*_fromType.copyForLocation(_toType.location(), _toType.isPointer())).equals(dynamic_cast(_toType)), "" ); solAssert(_fromType.isByteArrayOrString(), ""); @@ -2840,10 +2840,10 @@ string YulUtilFunctions::updateStorageValueFunction( .render(); } - solAssert(*toReferenceType->copyForLocation( + solAssert((*toReferenceType->copyForLocation( fromReferenceType->location(), fromReferenceType->isPointer() - ).get() == *fromReferenceType, ""); + ).get()).equals(*fromReferenceType), ""); if (fromReferenceType->category() == Type::Category::ArraySlice) solAssert(toReferenceType->category() == Type::Category::Array, "");