diff --git a/compiler/src/dmd/parse.d b/compiler/src/dmd/parse.d index b441935999..d5838825bf 100644 --- a/compiler/src/dmd/parse.d +++ b/compiler/src/dmd/parse.d @@ -6034,7 +6034,7 @@ LagainStc: auto statements = new AST.Statements(); while (token.value != TOK.rightCurly && token.value != TOK.endOfFile) { - statements.push(parseStatement(ParseStatementFlags.curlyScope)); + statements.push(parseStatement(ParseStatementFlags.curlyScope | ParseStatementFlags.semiOk)); } if (endPtr) *endPtr = token.ptr; diff --git a/compiler/test/compilable/emptystatement.d b/compiler/test/compilable/emptystatement.d new file mode 100644 index 0000000000..e6bfc27caa --- /dev/null +++ b/compiler/test/compilable/emptystatement.d @@ -0,0 +1,19 @@ +/* +REQUIRED_ARGS: +TEST_OUTPUT: +--- +--- +*/ + +void foo() +{ + int x;; + enum A + { + a, + b, + c + }; + + void bar() {}; +} diff --git a/compiler/test/fail_compilation/fail4559.d b/compiler/test/fail_compilation/fail4559.d deleted file mode 100644 index 657c184d78..0000000000 --- a/compiler/test/fail_compilation/fail4559.d +++ /dev/null @@ -1,22 +0,0 @@ -/* -REQUIRED_ARGS: -TEST_OUTPUT: ---- -fail_compilation/fail4559.d(13): Error: use `{ }` for an empty statement, not `;` -fail_compilation/fail4559.d(19): Error: use `{ }` for an empty statement, not `;` -fail_compilation/fail4559.d(21): Error: use `{ }` for an empty statement, not `;` ---- -*/ - -void foo() -{ - int x;; - enum A - { - a, - b, - c - }; - - void bar() {}; -}