On Wednesday, 20 December 2023 at 11:33:22 UTC, DLearner wrote:
The code below fails to compile with
Error: function `test1.foo` no `return exp;` or `assert(0);` at end of function
unless the commented-out assert(0) is included.

The compiler basically gives up control flow analysis when encountering a goto statement or labeled break/continue.
```D
bool foo()
{
   while(true)
   {
        L2:
        goto L2;
   }
//   assert(0);
}
```

Reply via email to