Replace void cast by maybe_unused

This commit is contained in:
Leonardo Alt 2020-01-07 15:45:57 +01:00
parent 17158995b5
commit a02308cfa5
3 changed files with 4 additions and 6 deletions

View File

@ -211,7 +211,7 @@ public:
/// Always returns a value greater than zero and throws if the type cannot be encoded in calldata
/// (or is dynamically encoded).
/// If @a _padded then it is assumed that each element is padded to a multiple of 32 bytes.
virtual unsigned calldataEncodedSize(bool _padded) const { (void)_padded; solAssert(false, ""); }
virtual unsigned calldataEncodedSize([[maybe_unused]] bool _padded) const { solAssert(false, ""); }
/// Convenience version of @see calldataEncodedSize(bool)
unsigned calldataEncodedSize() const { return calldataEncodedSize(true); }
/// @returns the distance between two elements of this type in a calldata array, tuple or struct.
@ -1432,7 +1432,7 @@ public:
BoolResult isImplicitlyConvertibleTo(Type const&) const override { return false; }
BoolResult isExplicitlyConvertibleTo(Type const&) const override { return false; }
TypeResult binaryOperatorResult(Token, Type const*) const override { return nullptr; }
unsigned calldataEncodedSize(bool _padded) const override { (void)_padded; return 32; }
unsigned calldataEncodedSize(bool) const override { return 32; }
bool canBeStored() const override { return false; }
bool canLiveOutsideStorage() const override { return false; }
bool isValueType() const override { return true; }

View File

@ -34,7 +34,7 @@ using namespace solidity::frontend::smt;
SMTPortfolio::SMTPortfolio(
map<h256, string> const& _smtlib2Responses,
ReadCallback::Callback const& _smtCallback,
SMTSolverChoice _enabledSolvers
[[maybe_unused]] SMTSolverChoice _enabledSolvers
)
{
m_solvers.emplace_back(make_unique<smt::SMTLib2Interface>(_smtlib2Responses, _smtCallback));
@ -46,7 +46,6 @@ SMTPortfolio::SMTPortfolio(
if (_enabledSolvers.cvc4)
m_solvers.emplace_back(make_unique<smt::CVC4Interface>());
#endif
(void)_enabledSolvers;
}
void SMTPortfolio::reset()

View File

@ -554,8 +554,7 @@ bool Parser::isValidNumberLiteral(string const& _literal)
try
{
// Try to convert _literal to u256.
auto tmp = u256(_literal);
(void) tmp;
[[maybe_unused]] auto tmp = u256(_literal);
}
catch (...)
{