diff --git a/docs/assembly.rst b/docs/assembly.rst index 3f00ab6a8a79..45ab1c04e2b8 100644 --- a/docs/assembly.rst +++ b/docs/assembly.rst @@ -46,6 +46,7 @@ Solidity language without a compiler change. pragma solidity >=0.4.16 <0.9.0; library GetCode { + // This will report a warning - at you will be promoted to reserved keyword function at(address addr) public view returns (bytes memory code) { assembly { // retrieve the size of the code, this needs assembly diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp index 1e3f5f1c2a56..29baa1f3813a 100644 --- a/libsolidity/analysis/SyntaxChecker.cpp +++ b/libsolidity/analysis/SyntaxChecker.cpp @@ -391,6 +391,9 @@ bool SyntaxChecker::visit(ContractDefinition const& _contract) "Functions are not allowed to have the same name as the contract. " "If you intend this to be a constructor, use \"constructor(...) { ... }\" to define it." ); + + checkFutureKeyword(_contract); + return true; } @@ -477,6 +480,8 @@ bool SyntaxChecker::visit(FunctionDefinition const& _function) else if (!_function.isImplemented() && !_function.modifiers().empty()) m_errorReporter.syntaxError(2668_error, _function.location(), "Functions without implementation cannot have modifiers."); + checkFutureKeyword(_function); + return true; } @@ -508,5 +513,31 @@ bool SyntaxChecker::visitNode(ASTNode const& _node) solAssert(m_sourceUnit); solAssert(m_sourceUnit->experimentalSolidity()); } + auto const* declaration = dynamic_cast(&_node); + if (declaration) + checkFutureKeyword(*declaration); return ASTConstVisitor::visitNode(_node); } + + +void SyntaxChecker::checkFutureKeyword(Declaration const& _declaration) +{ + std::set const futureKeywords = { + "transient", + "layout", + "at", + "error", + "super", + "this" + }; + if (futureKeywords.count(_declaration.name())) + m_errorReporter.warning( + 6335_error, + _declaration.location(), + fmt::format( + "\"{}\" will be promoted to reserved keyword in the next breaking version" + " and will not be allowed as an identifier anymore.", + _declaration.name() + ) + ); +} diff --git a/libsolidity/analysis/SyntaxChecker.h b/libsolidity/analysis/SyntaxChecker.h index 69bda229f701..69039945fd87 100644 --- a/libsolidity/analysis/SyntaxChecker.h +++ b/libsolidity/analysis/SyntaxChecker.h @@ -66,6 +66,10 @@ class SyntaxChecker: private ASTConstVisitor /// without a block. void checkSingleStatementVariableDeclaration(ASTNode const& _statement); + /// Reports a warning if the declaration name is scheduled to be + /// promoted to a keyword in the near future. + void checkFutureKeyword(Declaration const& _declaration); + bool visit(IfStatement const& _ifStatement) override; bool visit(WhileStatement const& _whileStatement) override; void endVisit(WhileStatement const& _whileStatement) override; diff --git a/libyul/AsmAnalysis.cpp b/libyul/AsmAnalysis.cpp index b36eb48b415e..2fcf730f29c0 100644 --- a/libyul/AsmAnalysis.cpp +++ b/libyul/AsmAnalysis.cpp @@ -298,6 +298,7 @@ void AsmAnalyzer::operator()(VariableDeclaration const& _varDecl) for (auto const& variable: _varDecl.variables) { expectValidIdentifier(variable.name, nativeLocationOf(variable)); + checkFutureReservedKeyword(variable.name, nativeLocationOf(variable)); } if (_varDecl.value) @@ -326,6 +327,7 @@ void AsmAnalyzer::operator()(FunctionDefinition const& _funDef) { yulAssert(!_funDef.name.empty()); expectValidIdentifier(_funDef.name, nativeLocationOf(_funDef)); + checkFutureReservedKeyword(_funDef.name, nativeLocationOf(_funDef)); Block const* virtualBlock = m_info.virtualBlocks.at(&_funDef).get(); yulAssert(virtualBlock, ""); Scope& varScope = scope(virtualBlock); @@ -951,3 +953,30 @@ void AsmAnalyzer::validateObjectStructure(langutil::SourceLocation const& _astRo } } } + +void AsmAnalyzer::checkFutureReservedKeyword(YulName _identifier, langutil::SourceLocation const& _location) +{ + std::set futureReservedKeywords{"leave"}; + if (m_evmVersion < langutil::EVMVersion::london()) + futureReservedKeywords.insert("basefee"); + if (m_evmVersion < langutil::EVMVersion::paris()) + futureReservedKeywords.insert("prevrandao"); + if (m_evmVersion < langutil::EVMVersion::cancun()) + { + futureReservedKeywords.insert("blobbasefee"); + futureReservedKeywords.insert("blobhash"); + futureReservedKeywords.insert("mcopy"); + futureReservedKeywords.insert("tstore"); + futureReservedKeywords.insert("tload"); + } + if (futureReservedKeywords.count(_identifier.str())) + m_errorReporter.warning( + 5470_error, + _location, + fmt::format( + "\"{}\" will be promoted to reserved keyword in the next breaking version " + "and will not be allowed anymore as an identifier.", + _identifier.str() + ) + ); +} diff --git a/libyul/AsmAnalysis.h b/libyul/AsmAnalysis.h index 51b8cde2ba1f..147fc551abe5 100644 --- a/libyul/AsmAnalysis.h +++ b/libyul/AsmAnalysis.h @@ -128,6 +128,8 @@ class AsmAnalyzer void validateObjectStructure(langutil::SourceLocation const& _astRootLocation); + void checkFutureReservedKeyword(YulName _identifier, langutil::SourceLocation const& _location); + yul::ExternalIdentifierAccess::Resolver m_resolver; Scope* m_currentScope = nullptr; /// Variables that are active at the current point in assembly (as opposed to diff --git a/test/libsolidity/syntaxTests/constants/constant_state_variable_named_transient.sol b/test/libsolidity/syntaxTests/constants/constant_state_variable_named_transient.sol index 4d9873d36d07..8c037e692dd7 100644 --- a/test/libsolidity/syntaxTests/constants/constant_state_variable_named_transient.sol +++ b/test/libsolidity/syntaxTests/constants/constant_state_variable_named_transient.sol @@ -2,3 +2,4 @@ contract C { int constant public transient = 0; } // ---- +// Warning 6335: (17-50): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. diff --git a/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type_fail.sol b/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type_fail.sol index cd46b15b0716..08f783aaf087 100644 --- a/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type_fail.sol +++ b/test/libsolidity/syntaxTests/dataLocations/data_location_in_function_type_fail.sol @@ -7,5 +7,6 @@ library L { // ---- // Warning 6162: (251-267): Naming function type parameters is deprecated. +// Warning 6335: (251-267): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (159-173): Data location must be "memory" or "calldata" for parameter in function, but "storage" was given. // TypeError 6651: (251-267): Data location must be "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_transient.sol b/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_transient.sol index 98fbb2d5ee66..93b701558d05 100644 --- a/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/externalFunction/function_argument_location_specifier_test_external_transient.sol @@ -2,4 +2,5 @@ contract test { function f(bytes transient) external; } // ---- +// Warning 6335: (31-46): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (31-46): Data location must be "memory" or "calldata" for parameter in external function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_transient.sol b/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_transient.sol index 4a5b6f999d86..61970ed1b4b9 100644 --- a/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/internalFunction/function_argument_location_specifier_test_internal_transient.sol @@ -2,4 +2,5 @@ contract test { function f(bytes transient) internal {} } // ---- +// Warning 6335: (31-46): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (31-46): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_with_data_location_transient.sol b/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_with_data_location_transient.sol index 75253342c4e0..14252383987d 100644 --- a/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_with_data_location_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/libraries/library_function_with_data_location_transient.sol @@ -9,6 +9,14 @@ library L { function i2() external pure returns (uint[] transient) { } } // ---- +// Warning 6335: (28-44): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (103-119): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (141-157): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (218-234): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (256-272): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (329-345): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (367-383): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (444-460): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (28-44): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given. // TypeError 6651: (103-119): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given. // TypeError 6651: (141-157): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_transient.sol b/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_transient.sol index 1dcedf49adcf..bd720d0bfede 100644 --- a/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/libraryExternalFunction/function_argument_location_specifier_test_external_transient.sol @@ -2,4 +2,5 @@ library test { function f(bytes transient) external {} } // ---- +// Warning 6335: (30-45): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (30-45): Data location must be "storage", "memory" or "calldata" for parameter in external function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_transient.sol b/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_transient.sol index d66fa7fadd2d..976fd170b221 100644 --- a/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/libraryInternalFunction/function_argument_location_specifier_test_internal_transient.sol @@ -2,4 +2,5 @@ library test { function f(bytes transient) internal pure {} } // ---- +// Warning 6335: (30-45): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (30-45): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_parameters_location_transient.sol b/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_parameters_location_transient.sol index 750aa4fee522..0ef17525de65 100644 --- a/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_parameters_location_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_parameters_location_transient.sol @@ -2,4 +2,5 @@ contract C { function f(uint[] transient) private pure {} } // ---- +// Warning 6335: (28-44): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (28-44): Data location must be "storage", "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_return_parameters_location_transient.sol b/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_return_parameters_location_transient.sol index d1bf8762480f..fa8d5f69757c 100644 --- a/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_return_parameters_location_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/privateFunction/private_function_return_parameters_location_transient.sol @@ -2,4 +2,5 @@ contract C { function f() private pure returns (uint[] transient) {} } // ---- +// Warning 6335: (52-68): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (52-68): Data location must be "storage", "memory" or "calldata" for return parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_transient.sol b/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_transient.sol index ce4f42f469e4..c8e7fdf44388 100644 --- a/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/publicFunction/function_argument_location_specifier_test_public_transient.sol @@ -2,4 +2,5 @@ contract test { function f(bytes transient) public; } // ---- +// Warning 6335: (31-46): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (31-46): Data location must be "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_return_parameters_location_transient.sol b/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_return_parameters_location_transient.sol index 862b7d236bfa..41b6ba47b1cc 100644 --- a/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_return_parameters_location_transient.sol +++ b/test/libsolidity/syntaxTests/dataLocations/publicFunction/public_function_return_parameters_location_transient.sol @@ -2,4 +2,5 @@ contract C { function h() public pure returns(uint[] transient) {} } // ---- +// Warning 6335: (50-66): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (50-66): Data location must be "memory" or "calldata" for return parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/dataLocations/transient_function_type_parameter.sol b/test/libsolidity/syntaxTests/dataLocations/transient_function_type_parameter.sol index 04f20e85c050..b34f2e92286a 100644 --- a/test/libsolidity/syntaxTests/dataLocations/transient_function_type_parameter.sol +++ b/test/libsolidity/syntaxTests/dataLocations/transient_function_type_parameter.sol @@ -3,3 +3,4 @@ contract C { } // ---- // Warning 6162: (27-41): Naming function type parameters is deprecated. +// Warning 6335: (27-41): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. diff --git a/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_exception.sol b/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_exception.sol index e7541fe233d4..84f620b71b8b 100644 --- a/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_exception.sol +++ b/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_exception.sol @@ -8,5 +8,7 @@ contract C { } } // ---- +// Warning 6335: (61-88): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (90-118): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // Warning 2319: (61-88): This declaration shadows a builtin symbol. // Warning 2319: (90-118): This declaration shadows a builtin symbol. diff --git a/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_functions.sol b/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_functions.sol index e6c7134850f6..5a42d229367c 100644 --- a/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_functions.sol +++ b/test/libsolidity/syntaxTests/duplicateFunctions/illegal_names_functions.sol @@ -10,6 +10,8 @@ contract C { } } // ---- +// Warning 6335: (84-117): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (123-155): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // DeclarationError 3726: (17-78): The name "_" is reserved. // DeclarationError 3726: (84-117): The name "super" is reserved. // DeclarationError 3726: (123-155): The name "this" is reserved. diff --git a/test/libsolidity/syntaxTests/enums/illegal_names.sol b/test/libsolidity/syntaxTests/enums/illegal_names.sol index 399d91ed1252..10d7b03623c1 100644 --- a/test/libsolidity/syntaxTests/enums/illegal_names.sol +++ b/test/libsolidity/syntaxTests/enums/illegal_names.sol @@ -21,6 +21,10 @@ contract C { E e; } // ---- +// Warning 6335: (0-19): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (20-40): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (72-76): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (82-87): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // DeclarationError 3726: (0-19): The name "this" is reserved. // DeclarationError 3726: (20-40): The name "super" is reserved. // DeclarationError 3726: (41-57): The name "_" is reserved. diff --git a/test/libsolidity/syntaxTests/events/illegal_names_exception.sol b/test/libsolidity/syntaxTests/events/illegal_names_exception.sol index c45db8d7d123..c72f0189ee1c 100644 --- a/test/libsolidity/syntaxTests/events/illegal_names_exception.sol +++ b/test/libsolidity/syntaxTests/events/illegal_names_exception.sol @@ -5,5 +5,7 @@ contract C { event _(); } // ---- +// Warning 6335: (80-93): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (95-109): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // Warning 2319: (80-93): This declaration shadows a builtin symbol. // Warning 2319: (95-109): This declaration shadows a builtin symbol. diff --git a/test/libsolidity/syntaxTests/events/illegal_names_exception_file_level.sol b/test/libsolidity/syntaxTests/events/illegal_names_exception_file_level.sol index 48b23dc38fb6..acdeb9979148 100644 --- a/test/libsolidity/syntaxTests/events/illegal_names_exception_file_level.sol +++ b/test/libsolidity/syntaxTests/events/illegal_names_exception_file_level.sol @@ -2,3 +2,6 @@ event this(); event super(); event _(); +// ---- +// Warning 6335: (66-79): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (80-94): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. diff --git a/test/libsolidity/syntaxTests/freeFunctions/illegal_names.sol b/test/libsolidity/syntaxTests/freeFunctions/illegal_names.sol index aed22b225b61..3aa7ae9427bb 100644 --- a/test/libsolidity/syntaxTests/freeFunctions/illegal_names.sol +++ b/test/libsolidity/syntaxTests/freeFunctions/illegal_names.sol @@ -10,6 +10,8 @@ contract C { } } // ---- +// Warning 6335: (0-18): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (19-38): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // DeclarationError 3726: (0-18): The name "this" is reserved. // DeclarationError 3726: (19-38): The name "super" is reserved. // DeclarationError 3726: (39-54): The name "_" is reserved. diff --git a/test/libsolidity/syntaxTests/functionTypes/function_type_with_transient_param.sol b/test/libsolidity/syntaxTests/functionTypes/function_type_with_transient_param.sol index b38e37177ea1..ce242db98b92 100644 --- a/test/libsolidity/syntaxTests/functionTypes/function_type_with_transient_param.sol +++ b/test/libsolidity/syntaxTests/functionTypes/function_type_with_transient_param.sol @@ -4,5 +4,7 @@ contract C { } // ---- // Warning 6162: (27-41): Naming function type parameters is deprecated. +// Warning 6335: (27-41): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // Warning 6162: (69-85): Naming function type parameters is deprecated. +// Warning 6335: (69-85): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // TypeError 6651: (69-85): Data location must be "memory" or "calldata" for parameter in function, but none was given. diff --git a/test/libsolidity/syntaxTests/immutable/illegal_names.sol b/test/libsolidity/syntaxTests/immutable/illegal_names.sol index a80083ed8ba5..2fcf2821a105 100644 --- a/test/libsolidity/syntaxTests/immutable/illegal_names.sol +++ b/test/libsolidity/syntaxTests/immutable/illegal_names.sol @@ -4,6 +4,8 @@ contract C { uint immutable this; } // ---- +// Warning 6335: (17-37): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (65-84): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // DeclarationError 3726: (17-37): The name "super" is reserved. // DeclarationError 3726: (43-59): The name "_" is reserved. // DeclarationError 3726: (65-84): The name "this" is reserved. diff --git a/test/libsolidity/syntaxTests/immutable/immutable_state_var_named_transient.sol b/test/libsolidity/syntaxTests/immutable/immutable_state_var_named_transient.sol index c0ac3a8abb3c..eb55acd8531d 100644 --- a/test/libsolidity/syntaxTests/immutable/immutable_state_var_named_transient.sol +++ b/test/libsolidity/syntaxTests/immutable/immutable_state_var_named_transient.sol @@ -2,3 +2,4 @@ contract C { address public immutable transient; } // ---- +// Warning 6335: (17-51): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/blobhash_pre_cancun_not_reserved.sol b/test/libsolidity/syntaxTests/inlineAssembly/blobhash_pre_cancun_not_reserved.sol index 1ac24cc6497a..eee9f5cba4ef 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/blobhash_pre_cancun_not_reserved.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/blobhash_pre_cancun_not_reserved.sol @@ -17,3 +17,5 @@ contract C { // ==== // EVMVersion: <=shanghai // ---- +// Warning 5470: (98-106): "blobhash" will be promoted to reserved keyword in the next breaking version and will not be allowed anymore as an identifier. +// Warning 5470: (237-303): "blobhash" will be promoted to reserved keyword in the next breaking version and will not be allowed anymore as an identifier. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/prevrandao_allowed_function_pre_paris.sol b/test/libsolidity/syntaxTests/inlineAssembly/prevrandao_allowed_function_pre_paris.sol index d85e77a45ef0..c9531412a587 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/prevrandao_allowed_function_pre_paris.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/prevrandao_allowed_function_pre_paris.sol @@ -18,3 +18,5 @@ contract C { // ==== // EVMVersion: =byzantium // ---- +// Warning 6335: (165-183): "error" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // Warning 5667: (49-55): Unused function parameter. Remove or comment out the variable name to silence this warning. // Warning 5667: (89-95): Unused try/catch parameter. Remove or comment out the variable name to silence this warning. // Warning 5667: (122-143): Unused try/catch parameter. Remove or comment out the variable name to silence this warning. diff --git a/test/libsolidity/syntaxTests/variableDeclaration/illegal_names.sol b/test/libsolidity/syntaxTests/variableDeclaration/illegal_names.sol index 24d1d98d6e67..8dba1dac08b4 100644 --- a/test/libsolidity/syntaxTests/variableDeclaration/illegal_names.sol +++ b/test/libsolidity/syntaxTests/variableDeclaration/illegal_names.sol @@ -12,6 +12,12 @@ contract D { struct _ { uint super; } } // ---- +// Warning 6335: (0-22): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (24-47): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (84-96): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (99-108): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (160-174): "this" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (188-198): "super" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. // DeclarationError 3726: (0-22): The name "this" is reserved. // DeclarationError 3726: (24-47): The name "super" is reserved. // DeclarationError 3726: (49-68): The name "_" is reserved. diff --git a/test/libsolidity/syntaxTests/variableDeclaration/transient_as_identifier.sol b/test/libsolidity/syntaxTests/variableDeclaration/transient_as_identifier.sol index ced189faf061..e1dc51fa1dd5 100644 --- a/test/libsolidity/syntaxTests/variableDeclaration/transient_as_identifier.sol +++ b/test/libsolidity/syntaxTests/variableDeclaration/transient_as_identifier.sol @@ -23,3 +23,11 @@ contract D { } } // ---- +// Warning 6335: (17-53): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (75-89): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (101-115): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (127-149): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (168-181): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (253-267): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (321-334): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. +// Warning 6335: (368-385): "transient" will be promoted to reserved keyword in the next breaking version and will not be allowed as an identifier anymore. diff --git a/test/libyul/yulSyntaxTests/blobbasefee_identifier_pre_cancun.yul b/test/libyul/yulSyntaxTests/blobbasefee_identifier_pre_cancun.yul index 42c1f2c0a680..81c7e1886766 100644 --- a/test/libyul/yulSyntaxTests/blobbasefee_identifier_pre_cancun.yul +++ b/test/libyul/yulSyntaxTests/blobbasefee_identifier_pre_cancun.yul @@ -4,3 +4,4 @@ // ==== // EVMVersion: <=shanghai // ---- +// Warning 5470: (6-31): "blobbasefee" will be promoted to reserved keyword in the next breaking version and will not be allowed anymore as an identifier. diff --git a/test/libyul/yulSyntaxTests/blobhash_pre_cancun.yul b/test/libyul/yulSyntaxTests/blobhash_pre_cancun.yul index 777024cda0eb..33ec5d695933 100644 --- a/test/libyul/yulSyntaxTests/blobhash_pre_cancun.yul +++ b/test/libyul/yulSyntaxTests/blobhash_pre_cancun.yul @@ -11,3 +11,5 @@ // ==== // EVMVersion: <=shanghai // ---- +// Warning 5470: (20-28): "blobhash" will be promoted to reserved keyword in the next breaking version and will not be allowed anymore as an identifier. +// Warning 5470: (55-77): "blobhash" will be promoted to reserved keyword in the next breaking version and will not be allowed anymore as an identifier. diff --git a/test/libyul/yulSyntaxTests/mcopy_as_identifier_pre_cancun.yul b/test/libyul/yulSyntaxTests/mcopy_as_identifier_pre_cancun.yul index 096fce4ed3bb..b0c5c0ebf0b4 100644 --- a/test/libyul/yulSyntaxTests/mcopy_as_identifier_pre_cancun.yul +++ b/test/libyul/yulSyntaxTests/mcopy_as_identifier_pre_cancun.yul @@ -10,3 +10,6 @@ } // ==== // EVMVersion: