From c400c61fc32f514a4be0b57bda97ef576dc03a1e Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Thu, 10 Dec 2020 17:20:30 +0100 Subject: [PATCH 1/2] Fix incorrect behaviour on clang 6. --- libsolidity/formal/CHC.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsolidity/formal/CHC.cpp b/libsolidity/formal/CHC.cpp index edeaa5b23..bc20f3319 100644 --- a/libsolidity/formal/CHC.cpp +++ b/libsolidity/formal/CHC.cpp @@ -164,11 +164,11 @@ void CHC::endVisit(ContractDefinition const& _contract) if (base != &_contract) { m_callGraph[&_contract].insert(base); - vector> const& args = baseArgs.count(base) ? baseArgs.at(base) : decltype(args){}; auto baseConstructor = base->constructor(); - if (baseConstructor && !args.empty()) + if (baseConstructor && baseArgs.count(base)) { + vector> const& args = baseArgs.at(base); auto const& params = baseConstructor->parameters(); solAssert(params.size() == args.size(), ""); for (unsigned i = 0; i < params.size(); ++i) From 4cb9a42d9ae68386fcc8d204ea7bf8ece7f24ba6 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Thu, 10 Dec 2020 17:20:49 +0100 Subject: [PATCH 2/2] Verify minimal clang version in cmake. --- cmake/EthCompilerSettings.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index 313717101..066ca74d8 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -65,11 +65,8 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA # Additional GCC-specific compiler settings. if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") - # Check that we've got GCC 8.0 or newer. - execute_process( - COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) - if (NOT (GCC_VERSION VERSION_GREATER 8.0 OR GCC_VERSION VERSION_EQUAL 8.0)) + if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)) message(FATAL_ERROR "${PROJECT_NAME} requires g++ 8.0 or greater.") endif () @@ -78,6 +75,11 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA # Additional Clang-specific compiler settings. elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + # Check that we've got clang 7.0 or newer. + if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0)) + message(FATAL_ERROR "${PROJECT_NAME} requires clang++ 7.0 or greater.") + endif () + if ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") # Set stack size to 32MB - by default Apple's clang defines a stack size of 8MB. # Normally 16MB is enough to run all tests, but it will exceed the stack, if -DSANITIZE=address is used.