Merge pull request #2464 from federicobond/deprecate-function-type-names

Warn deprecated usage of parameter names in function types
This commit is contained in:
chriseth
2017-06-27 16:32:48 +02:00
committed by GitHub
4 changed files with 36 additions and 2 deletions
+12
View File
@@ -148,3 +148,15 @@ bool SyntaxChecker::visit(PlaceholderStatement const&)
return true;
}
bool SyntaxChecker::visit(FunctionTypeName const& _node)
{
for (auto const& decl: _node.parameterTypeList()->parameters())
if (!decl->name().empty())
m_errorReporter.warning(decl->location(), "Naming function type parameters is deprecated.");
for (auto const& decl: _node.returnParameterTypeList()->parameters())
if (!decl->name().empty())
m_errorReporter.warning(decl->location(), "Naming function type return parameters is deprecated.");
return true;
}
+2
View File
@@ -63,6 +63,8 @@ private:
virtual bool visit(PlaceholderStatement const& _placeholderStatement) override;
virtual bool visit(FunctionTypeName const& _node) override;
ErrorReporter& m_errorReporter;
/// Flag that indicates whether a function modifier actually contains '_'.