aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-22 22:17:19 +0800
committerGitHub <noreply@github.com>2018-02-22 22:17:19 +0800
commit8fc9535d43df26001f7b34488d073c06fc4fd358 (patch)
treea25e8823ba9d06d42ba43beb856fbbe6dd42fa2c
parent090d7037409247bd16fc0f9ae41500fa42dde498 (diff)
parentc182284d28faa45e668fe20293e9e08734187ee3 (diff)
downloaddexon-solidity-8fc9535d43df26001f7b34488d073c06fc4fd358.tar.gz
dexon-solidity-8fc9535d43df26001f7b34488d073c06fc4fd358.tar.zst
dexon-solidity-8fc9535d43df26001f7b34488d073c06fc4fd358.zip
Merge pull request #3565 from ethereum/doNotWarnAboutAnalysisOnlyExpFeatures
Do not warn about analysis-only experimental features.
-rw-r--r--Changelog.md1
-rw-r--r--libsolidity/analysis/SyntaxChecker.cpp6
-rw-r--r--test/libsolidity/SMTChecker.cpp7
3 files changed, 6 insertions, 8 deletions
diff --git a/Changelog.md b/Changelog.md
index ad92c94a..f0d00416 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -4,6 +4,7 @@ Features:
* Code Generator: Assert that ``k != 0`` for ``molmod(a, b, k)`` and ``addmod(a, b, k)`` as experimental 0.5.0 feature.
* Standard JSON: Reject badly formatted invalid JSON inputs.
* Type Checker: Disallow uninitialized storage pointers as experimental 0.5.0 feature.
+ * Syntax Analyser: Do not warn about experimental features if they do not concern code generation.
Bugfixes:
* Assembly: Raise error on oversized number literals in assembly.
diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp
index 5a3745b0..74834ba4 100644
--- a/libsolidity/analysis/SyntaxChecker.cpp
+++ b/libsolidity/analysis/SyntaxChecker.cpp
@@ -93,8 +93,10 @@ bool SyntaxChecker::visit(PragmaDirective const& _pragma)
m_errorReporter.syntaxError(_pragma.location(), "Duplicate experimental feature name.");
else
{
- m_sourceUnit->annotation().experimentalFeatures.insert(ExperimentalFeatureNames.at(literal));
- m_errorReporter.warning(_pragma.location(), "Experimental features are turned on. Do not use experimental features on live deployments.");
+ auto feature = ExperimentalFeatureNames.at(literal);
+ m_sourceUnit->annotation().experimentalFeatures.insert(feature);
+ if (!ExperimentalFeatureOnlyAnalysis.count(feature))
+ m_errorReporter.warning(_pragma.location(), "Experimental features are turned on. Do not use experimental features on live deployments.");
}
}
}
diff --git a/test/libsolidity/SMTChecker.cpp b/test/libsolidity/SMTChecker.cpp
index 8c955292..5088ab94 100644
--- a/test/libsolidity/SMTChecker.cpp
+++ b/test/libsolidity/SMTChecker.cpp
@@ -35,12 +35,6 @@ namespace test
class SMTCheckerFramework: public AnalysisFramework
{
-public:
- SMTCheckerFramework()
- {
- m_warningsToFilter.push_back("Experimental features are turned on.");
- }
-
protected:
virtual std::pair<SourceUnit const*, ErrorList>
parseAnalyseAndReturnError(
@@ -103,6 +97,7 @@ BOOST_AUTO_TEST_CASE(warn_on_struct)
}
)";
CHECK_WARNING_ALLOW_MULTI(text, (vector<string>{
+ "Experimental feature",
"Assertion checker does not yet implement this expression.",
"Assertion checker does not yet support the type of this variable."
}));