diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-10-03 22:28:29 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-10-06 02:02:30 +0800 |
commit | 81519845bc35043c8460252e62a30a137f93432d (patch) | |
tree | e6f7b4daf9db485a2932524f9084b615595de82d /libsolidity | |
parent | d0fa56a217f50458b128b0a570724cdac0a5ee1a (diff) | |
download | dexon-solidity-81519845bc35043c8460252e62a30a137f93432d.tar.gz dexon-solidity-81519845bc35043c8460252e62a30a137f93432d.tar.zst dexon-solidity-81519845bc35043c8460252e62a30a137f93432d.zip |
Require location keyword for local variables (0.5.0)
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/ReferencesResolver.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp index 20016112..29278332 100644 --- a/libsolidity/analysis/ReferencesResolver.cpp +++ b/libsolidity/analysis/ReferencesResolver.cpp @@ -298,11 +298,19 @@ void ReferencesResolver::endVisit(VariableDeclaration const& _variable) { typeLoc = DataLocation::Storage; if (_variable.isLocalVariable()) - m_errorReporter.warning( - _variable.location(), - "Variable is declared as a storage pointer. " - "Use an explicit \"storage\" keyword to silence this warning." - ); + { + if (_variable.sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050)) + typeError( + _variable.location(), + "Storage location must be specified as either \"memory\" or \"storage\"." + ); + else + m_errorReporter.warning( + _variable.location(), + "Variable is declared as a storage pointer. " + "Use an explicit \"storage\" keyword to silence this warning." + ); + } } } else |