Bug 11751 – [REG2.065a] Hex float exponents should be decimal
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-12-15T22:25:00Z
Last change time
2015-06-17T21:03:47Z
Keywords
accepts-invalid, pull, wrong-code
Assigned to
nobody
Creator
jiki
Comments
Comment #0 by jiki — 2013-12-15T22:25:22Z
Dmd has been changed to accept hex float exponent by hexadecimal (and 'F' suffix, too).
This is a regression.
In the spec:
HexExponent:
HexExponentStart DecimalDigitsNoSingleUS
This regression is introduced by Pull 2923.
https://github.com/D-Programming-Language/dmd/pull/2923
"redo lexing of float literals"
Its comment:
Shouldn't be any behavior changes.
Comment #1 by bugzilla — 2013-12-16T11:09:27Z
Can you give an example?
Comment #2 by k.hara.pg — 2013-12-16T16:37:04Z
(In reply to comment #1)
> Can you give an example?
auto x = 0x1.FFFFFFFFFFFFFpABC;
// ^^^
With 2.064.2:
test.d(1): Error: exponent expected
test.d(1): Error: semicolon expected following auto declaration, not 'BC'
test.d(1): Error: no identifier for declarator BC
With git head:
(no compilation error)
Comment #3 by jiki — 2013-12-16T17:07:18Z
(In reply to comment #2)
Thanks.
(In reply to comment #1)
>Can you give an example?
More actual one:
static assert( is(float==typeof(0x0.1p1F)) );
Success in 2.064.
Failure in 2.065a because dmd sees the last 'F' as a part of the exponent.