aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-07-11 00:30:41 +0800
committerchriseth <chris@ethereum.org>2017-07-11 00:30:41 +0800
commit883666d2c0cf602640a52b26d5ef7da9da3018f4 (patch)
treea6c7f8589da563c82470ed97262cf30fa91ff08f
parentaafcc3606cc20be1e7e8fe70494c63bb4f98d7fa (diff)
downloaddexon-solidity-883666d2c0cf602640a52b26d5ef7da9da3018f4.tar.gz
dexon-solidity-883666d2c0cf602640a52b26d5ef7da9da3018f4.tar.zst
dexon-solidity-883666d2c0cf602640a52b26d5ef7da9da3018f4.zip
Fix invalid "explicit storage keyword" warning for reference members of structs.
-rw-r--r--Changelog.md1
-rw-r--r--libsolidity/analysis/ReferencesResolver.cpp2
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp2
3 files changed, 3 insertions, 2 deletions
diff --git a/Changelog.md b/Changelog.md
index b3a37590..9afb0679 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -3,6 +3,7 @@
Features:
Bugfixes:
+ * Type Checker: Fix invalid "specify storage keyword" warning for reference members of structs.
### 0.4.13 (2017-07-06)
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp
index cc95c294..8f07d43a 100644
--- a/libsolidity/analysis/ReferencesResolver.cpp
+++ b/libsolidity/analysis/ReferencesResolver.cpp
@@ -295,7 +295,7 @@ void ReferencesResolver::endVisit(VariableDeclaration const& _variable)
else
{
typeLoc = DataLocation::Storage;
- if (!_variable.isStateVariable())
+ if (_variable.isLocalVariable())
m_errorReporter.warning(
_variable.location(),
"Variable is declared as a storage pointer. "
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 108128f7..3c49051e 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -6160,7 +6160,7 @@ BOOST_AUTO_TEST_CASE(warn_unspecified_storage)
{
char const* text = R"(
contract C {
- struct S { uint a; }
+ struct S { uint a; string b; }
S x;
function f() {
S storage y = x;