[Issue 18026] Stack overflow in ddmd/dtemplate.d:6241, TemplateInstance::needsCodegen()

2018-05-03 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18026

--- Comment #6 from JR  ---
I can no longer reproduce with 2.079.1 nor 2.080.0, on the same machines that
previously exhibited the overflow.

Was something changed, or is it merely being tricky again?

--


[Issue 18822] [REG 2.080.0] Compiling byGrapheme Fails

2018-05-03 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18822

--- Comment #1 from Jack Stouffer  ---
Introduced in https://github.com/dlang/phobos/pull/6235

So, what's happening is that the toString of Appender now uses formatValue,
which calls formatRange, which calls graphemeStride. Grapheme uses TrieBuilder,
which uses std.conv.text for an error message which uses Appender, and you can
see the problem.

--


[Issue 18822] New: [REG 2.080.0] Compiling byGrapheme Fails

2018-05-03 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18822

  Issue ID: 18822
   Summary: [REG 2.080.0] Compiling byGrapheme Fails
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: regression
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: j...@jackstouffer.com

CODE:

void main()
{
import std.uni;
string a = "test";
auto b = a.byGrapheme;
}

$ dmd --version
DMD64 D Compiler v2.080.0

$ dmd -unittest -main -run source/yarn.d
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(7010): Error: forward reference
to inferred return type of function call hangLV()
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(7040): Error: forward reference
to inferred return type of function call hangLV()
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(7110): Error: template instance
`std.uni.genericDecodeGrapheme!false.genericDecodeGrapheme!(const(char)[])`
error instantiating
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3206):instantiated
from here: graphemeStride!char
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(2890):instantiated
from here: formatRange!(Appender!string, string, char)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(1845):instantiated
from here: formatValueImpl!(Appender!string, string, char)
/usr/local/opt/dmd/include/dlang/dmd/std/array.d(3268):... (7
instantiations, -v to show) ...
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10432):instantiated from
here: CodepointTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10502):instantiated from
here: asTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/conv.d(1018): Error: template instance
`std.conv.toStr!(string, char)` error instantiating
/usr/local/opt/dmd/include/dlang/dmd/std/conv.d(222):instantiated from
here: toImpl!(string, char)
/usr/local/opt/dmd/include/dlang/dmd/std/conv.d(4255):instantiated from
here: to!char
/usr/local/opt/dmd/include/dlang/dmd/std/conv.d(4194):instantiated from
here: textImpl!(string, string, char)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(486):... (13
instantiations, -v to show) ...
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10432):instantiated from
here: CodepointTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10502):instantiated from
here: asTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/conv.d(4194): Error: template instance
`std.conv.textImpl!(string, string, string, string)` error instantiating
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(4509):instantiated
from here: text!(string, string, string)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(4484):instantiated
from here: getNth!("integer width", isIntegral, int, uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(492):instantiated
from here: getNthInt!("integer width", uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3400):... (12
instantiations, -v to show) ...
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10432):instantiated from
here: CodepointTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10502):instantiated from
here: asTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(4484): Error: template
instance `std.format.getNth!("integer precision", isIntegral, int, uint)` error
instantiating
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(518):instantiated
from here: getNthInt!("integer precision", uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3400):instantiated
from here: formattedWrite!(Appender!string, char, uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3496):instantiated
from here: formatChar!(Appender!string)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3339):... (10
instantiations, -v to show) ...
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10432):instantiated from
here: CodepointTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10502):instantiated from
here: asTrie!(bool, 8, 5, 8)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(4484): Error: template
instance `std.format.getNth!("separator digit width", isIntegral, int, uint)`
error instantiating
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(538):instantiated
from here: getNthInt!("separator digit width", uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3400):instantiated
from here: formattedWrite!(Appender!string, char, uint)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3496):instantiated
from here: formatChar!(Appender!string)
/usr/local/opt/dmd/include/dlang/dmd/std/format.d(3339):... (10
instantiations, -v to show) ...
/usr/local/opt/dmd/include/dlang/dmd/std/uni.d(10432):instantiated from
here: CodepointTrie!(bool, 

[Issue 18819] DMD compilation crash

2018-05-03 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18819

--- Comment #2 from ki...@gmx.net ---
(In reply to kinke from comment #1)
> I just glanced at the code, but it appears invalid (specifically,
> emplaceRef() for a 0-sized T), see https://github.com/dlang/phobos/pull/6480.

Disregard, there's no 0-sized type in there, and DMD obviously shouldn't crash
anyway.

--


[Issue 18819] DMD compilation crash

2018-05-03 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18819

ki...@gmx.net changed:

   What|Removed |Added

 CC||ki...@gmx.net

--- Comment #1 from ki...@gmx.net ---
I just glanced at the code, but it appears invalid (specifically, emplaceRef()
for a 0-sized T), see https://github.com/dlang/phobos/pull/6480.

--


[Issue 18821] DMD segfault 2.080

2018-05-03 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18821

Mr. Smith  changed:

   What|Removed |Added

 CC||mrsmit...@yandex.ru

--


[Issue 18821] New: DMD segfault 2.080

2018-05-03 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18821

  Issue ID: 18821
   Summary: DMD segfault 2.080
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: mrsmit...@yandex.ru

Happens on travis build. Cannot reproduce on Windows.
https://travis-ci.org/MrSmith33/voxelman/jobs/374350765

--


[Issue 18820] dip1000 mangling is different for inferred templates

2018-05-03 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18820

Seb  changed:

   What|Removed |Added

 CC||greensunn...@gmail.com

--


[Issue 18820] New: dip1000 mangling is different for inferred templates

2018-05-03 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18820

  Issue ID: 18820
   Summary: dip1000 mangling is different for inferred templates
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: link-failure, safe
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: schvei...@yahoo.com
CC: bugzi...@digitalmars.com

If a template/auto function has attributes inferred, and you compile a module
with dip1000 and another module without, the mangling may depend on new
attributes inferred by dip1000, which makes it impossible to link.

Example:

- mod2.d:
module mod2;

auto foo(T)(T s) @safe
{
return s;
}

auto foo2(scope string s)
{
return foo(s);
}

- mod1.d:
module mod1;
import mod2;

void main()
{
scope string s;
auto x = foo2(s);
}

If we compile like this:
dmd -c mod2.d
dmd -dip1000 mod1.d mod2.o

We have linker errors.

Compiling both together works:
dmd mod1.d mod2.d
dmd -dip1000 mod1.d mod2.d

The fundamental problem here is that it makes dip1000 NOT an optional switch,
but a required switch. So if we plan to ship with dip1000, it will force
everyone not only to use dip1000, but to make sure ALL their code (including
code they may not control) to use dip1000.

I don't know a solution to this other than to ship 2 libraries.

Walter asked me to add this so there is a bugzilla report about it.

See discussions at:
https://github.com/dlang/phobos/pull/5915#issuecomment-350425051
https://github.com/dlang/dmd/pull/8124#issuecomment-379299121
https://github.com/dlang/phobos/pull/6443

--