diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 2 | ||||
-rw-r--r-- | test/libsolidity/syntaxTests/empty_struct.sol | 5 | ||||
-rw-r--r-- | test/libsolidity/syntaxTests/empty_struct_050.sol | 6 |
3 files changed, 12 insertions, 1 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index e5269bc5..dd29bf48 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -7289,7 +7289,7 @@ BOOST_AUTO_TEST_CASE(modifiers_access_storage_pointer) { char const* text = R"( contract C { - struct S { } + struct S { uint a; } modifier m(S storage x) { x; _; diff --git a/test/libsolidity/syntaxTests/empty_struct.sol b/test/libsolidity/syntaxTests/empty_struct.sol new file mode 100644 index 00000000..dcced618 --- /dev/null +++ b/test/libsolidity/syntaxTests/empty_struct.sol @@ -0,0 +1,5 @@ +contract test { + struct A {} +} +// ---- +// Warning: Defining empty structs is deprecated. diff --git a/test/libsolidity/syntaxTests/empty_struct_050.sol b/test/libsolidity/syntaxTests/empty_struct_050.sol new file mode 100644 index 00000000..dbec93c4 --- /dev/null +++ b/test/libsolidity/syntaxTests/empty_struct_050.sol @@ -0,0 +1,6 @@ +pragma experimental "v0.5.0"; +contract test { + struct A {} +} +// ---- +// SyntaxError: Defining empty structs is disallowed. |