Increase use of C++ constexpr constant expressions in code base as described in issue #7720

This commit is contained in:
benldrmn
2021-08-31 15:03:59 +02:00
committed by Marenz
parent 13691dfbaa
commit 58e4cc62e0
6 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -856,7 +856,7 @@ void EVMHostPrinter::selfdestructRecords()
void EVMHostPrinter::callRecords()
{
static const auto callKind = [](evmc_call_kind _kind) -> string
static auto constexpr callKind = [](evmc_call_kind _kind) -> string
{
switch (_kind)
{
+2 -3
View File
@@ -49,9 +49,8 @@ namespace solidity::test
using rational = boost::rational<bigint>;
// The ether and gwei denominations; here for ease of use where needed within code.
static const u256 gwei = u256(1) << 9;
static const u256 ether = u256(1) << 18;
static u256 const gwei = u256(1) << 9;
static u256 const ether = u256(1) << 18;
class ExecutionFramework
{
+1 -1
View File
@@ -78,7 +78,7 @@ void FuzzerUtil::testCompilerJsonInterface(string const& _input, bool _optimize,
void FuzzerUtil::forceSMT(StringMap& _input)
{
// Add SMT checker pragma if not already present in source
static const char* smtPragma = "pragma experimental SMTChecker;";
static auto constexpr smtPragma = "pragma experimental SMTChecker;";
for (auto &sourceUnit: _input)
if (sourceUnit.second.find(smtPragma) == string::npos)
sourceUnit.second += smtPragma;