aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-02-27 22:21:23 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-02-27 23:31:53 +0800
commita566825589a2c0d41e2e136527b98737cffb5701 (patch)
tree4876d2559efdd02d11ba169dcd53801e4f981bf6 /libsolidity/analysis
parent2abc5be7e628c18562f1df546137fcb0748ecbb2 (diff)
downloaddexon-solidity-a566825589a2c0d41e2e136527b98737cffb5701.tar.gz
dexon-solidity-a566825589a2c0d41e2e136527b98737cffb5701.tar.zst
dexon-solidity-a566825589a2c0d41e2e136527b98737cffb5701.zip
Issue error if no visibility is specified (on 0.5.0)
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/SyntaxChecker.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp
index 1dcfeb27..ddac194b 100644
--- a/libsolidity/analysis/SyntaxChecker.cpp
+++ b/libsolidity/analysis/SyntaxChecker.cpp
@@ -212,13 +212,20 @@ bool SyntaxChecker::visit(PlaceholderStatement const&)
bool SyntaxChecker::visit(FunctionDefinition const& _function)
{
+ bool const v050 = m_sourceUnit->annotation().experimentalFeatures.count(ExperimentalFeature::V050);
+
if (_function.noVisibilitySpecified())
- m_errorReporter.warning(
- _function.location(),
- "No visibility specified. Defaulting to \"" +
- Declaration::visibilityToString(_function.visibility()) +
- "\"."
- );
+ {
+ if (v050)
+ m_errorReporter.syntaxError(_function.location(), "No visibility specified.");
+ else
+ m_errorReporter.warning(
+ _function.location(),
+ "No visibility specified. Defaulting to \"" +
+ Declaration::visibilityToString(_function.visibility()) +
+ "\"."
+ );
+ }
return true;
}