Merge pull request #2551 from ethereum/fixStructMemberWarning

Fix invalid "explicit storage keyword" warning for reference members of structs.
This commit is contained in:
Alex Beregszaszi 2017-07-10 19:31:09 +02:00 committed by GitHub
commit 6fa5d47f8f
3 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -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. "

View File

@ -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;