From 81519845bc35043c8460252e62a30a137f93432d Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 3 Oct 2017 15:28:29 +0100 Subject: Require location keyword for local variables (0.5.0) --- libsolidity/analysis/ReferencesResolver.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'libsolidity') 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 -- cgit v1.2.3