https://issues.dlang.org/show_bug.cgi?id=20479

Mathias LANG <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |betterC
                 CC|                            |[email protected]
           Hardware|x86                         |All
                 OS|Mac OS X                    |All
           Severity|enhancement                 |normal

--- Comment #2 from Mathias LANG <[email protected]> ---
Actually the issue is valid, but it would have been nice to post the error
messages you're getting.

First, using the op's code, we get the following error with the latest DMD
(2.090.0):
```
dmd -betterC foo.d
/usr/local/opt/dmd/include/dlang/dmd/std/array.d(965): Error: TypeInfo cannot
be used with -betterC
```

Which is obviously wrong, as `octal` should not lead to code being emitted in
the binary.
Then, if we tweak the code a bit:
```
import core.stdc.stdio;
import std.conv : octal;

extern(C) void main()
{
    enum b = octal!"167";
    printf("Octal literal: %d\n", b);
}
```

We get the following link error:
```
dmd -betterC -run foo.d
Undefined symbols for architecture x86_64:
  "__D3std4conv14isOctalLiteralFNaNbNiNfxAyaZb", referenced from:
      __D3std4conv__T5octalTiZQjFNaNbNiNfxAyaZi in foo.o
ld: symbol(s) not found for architecture x86_64
```

Turning the symbol into a `static immutable` doesn't help either.

--

Reply via email to