From c4b7916c144355dc36591fb6aad89438942b6c9a Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 23 Sep 2015 17:25:59 +0200 Subject: Test that literal strings cannot be assigned to storage pointers. --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 8346b8ca..cac16682 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -2308,6 +2308,16 @@ BOOST_AUTO_TEST_CASE(array_out_of_bound_access) SOLIDITY_CHECK_ERROR_TYPE(parseAndAnalyseReturnError(text), TypeError); } +BOOST_AUTO_TEST_CASE(literal_string_to_storage_pointer) +{ + char const* text = R"( + contract C { + function f() { string x = "abc"; } + } + )"; + SOLIDITY_CHECK_ERROR_TYPE(parseAndAnalyseReturnError(text), TypeError); +} + BOOST_AUTO_TEST_SUITE_END() } -- cgit