diff --git a/libsolidity/InterfaceHandler.cpp b/libsolidity/InterfaceHandler.cpp index 36940d278..3b87032bc 100644 --- a/libsolidity/InterfaceHandler.cpp +++ b/libsolidity/InterfaceHandler.cpp @@ -165,7 +165,7 @@ void InterfaceHandler::generateUserDocumentation(ContractDefinition& _contractDe } doc["methods"] = methods; - _contractDef.setUserDocumentation(string(Json::FastWriter().write(doc))); + _contractDef.setUserDocumentation(Json::FastWriter().write(doc)); } unique_ptr InterfaceHandler::userDocumentation(ContractDefinition const& _contractDef) @@ -239,7 +239,7 @@ void InterfaceHandler::generateDevDocumentation(ContractDefinition& _contractDef } doc["methods"] = methods; - _contractDef.setDevDocumentation(string(Json::FastWriter().write(doc))); + _contractDef.setDevDocumentation(Json::FastWriter().write(doc)); } /* -- private -- */ diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 70de7be56..d44545145 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4668,7 +4668,7 @@ BOOST_AUTO_TEST_CASE(dev_title_at_function_error) " function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n" "}\n"; - compileRequireThrow(sourceCode); + compileRequireThrow(sourceCode); } BOOST_AUTO_TEST_CASE(dev_documenting_nonexistant_param) @@ -4680,7 +4680,7 @@ BOOST_AUTO_TEST_CASE(dev_documenting_nonexistant_param) " function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n" "}\n"; - compileRequireThrow(sourceCode); + compileRequireThrow(sourceCode); } diff --git a/test/libsolidity/solidityExecutionFramework.h b/test/libsolidity/solidityExecutionFramework.h index c09d80a6e..f4dbbcb97 100644 --- a/test/libsolidity/solidityExecutionFramework.h +++ b/test/libsolidity/solidityExecutionFramework.h @@ -58,11 +58,12 @@ public: return m_output; } + template void compileRequireThrow(std::string const& _sourceCode) { m_compiler.reset(false, m_addStandardSources); m_compiler.addSource("", _sourceCode); - BOOST_REQUIRE_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), DocstringParsingError); + BOOST_REQUIRE_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), Exceptiontype); } bytes const& compileAndRun(