[Issue 3827] Warn against and then deprecate implicit concatenation of adjacent string literals
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Apr 30 06:50:34 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=3827
--- Comment #39 from yebblies <yebblies at gmail.com> ---
(In reply to bearophile_hugs from comment #37)
> (In reply to yebblies from comment #36)
>
> > Try it, look at the asm. No memory allocation.
>
> The asm is not enough. @nogc is a purely front-end thing, to avoid different
> optimizations in different compilers to lead to @nogc-annotated code to
> compile or not compile in different compilers. So this problem is not a bug,
> it's an enhancement request, to add this optimization in the front-end.
As nice as that all sounds, the reality is that the dmd frontend currently
defines which optimizations are guaranteed by the frontend.
There are many places where const-folding already affects semantics (especially
implicit conversions).
Tying improving the usability of @nogc to a mythical optimization spec will
likely only achieve preventing improvement to the usability of @nogc.
> to add this optimization in the front-end.
That is exactly where const-folding is done.
--
More information about the Digitalmars-d-bugs
mailing list