[Issue 15985] [REG2.068/2.069] Code doesn't link unless compiled with -debug

2023-02-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15985

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Dlang Bot  ---
dlang/dmd pull request #14855 "fix Issue 15985 - [REG2.068/2.069] Code doesn't
link unless compiled …" was merged into master:

- a476bc101e5c3172b8f18479fbf4557ba35a5a8a by Walter Bright:
  fix Issue 15985 - [REG2.068/2.069] Code doesn't link unless compiled with
-debug

https://github.com/dlang/dmd/pull/14855

--


[Issue 15985] [REG2.068/2.069] Code doesn't link unless compiled with -debug

2023-01-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15985

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #8 from Dlang Bot  ---
@WalterBright created dlang/dmd pull request #14855 "fix Issue 15985 -
[REG2.068/2.069] Code doesn't link unless compiled …" fixing this issue:

- fix Issue 15985 - [REG2.068/2.069] Code doesn't link unless compiled with
-debug

https://github.com/dlang/dmd/pull/14855

--


[Issue 15985] [REG2.068/2.069] Code doesn't link unless compiled with -debug

2023-01-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15985

--- Comment #7 from Iain Buclaw  ---
(In reply to Walter Bright from comment #6)
> 
> Here's what I suspect is going on with this. Let's follow the semantic
> analsysis:
> 

DMD's default behaviour is to eagerly prune templates it expects to be
instantiated elsewhere. Undefined references are expected as a default
behaviour.

If undefined errors still persist with -allinst, then that's a bug that needs
fixing.

--


[Issue 15985] [REG2.068/2.069] Code doesn't link unless compiled with -debug

2023-01-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15985

--- Comment #6 from Walter Bright  ---
(In reply to ag0aep6g from comment #4)
> void f()()
> {
> g!()();
> h!()();
> }
> 
> void g()() { f!()(); }
> void h()() { f!()(); }
> 
> enum x = is(typeof(f!()()));
> alias my_g = g!();
> 
> void main() {}

Here's what I suspect is going on with this. Let's follow the semantic
analsysis:

1. x is the first to get semantically analyzed. The typeof instantiates f!()

2. f!() instantiates g!() and h!()

3. my_g instantiates g!() directly

h!() is only instantiated indirectly, and since that instantiation happens
during a typeof, it never gets marked as needing code to be generated for it.

--


[Issue 15985] [REG2.068/2.069] Code doesn't link unless compiled with -debug

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15985

Iain Buclaw  changed:

   What|Removed |Added

 CC||ibuc...@gdcproject.org

--- Comment #5 from Iain Buclaw  ---
Original test was fixed by https://github.com/dlang/dmd/pull/13224

All other reductions still fail, and now fail *with* -debug ever since this
change. https://github.com/dlang/dmd/pull/10968

--


[Issue 15985] [REG2.068/2.069] Code doesn't link unless compiled with -debug

2017-10-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15985

ag0ae...@gmail.com changed:

   What|Removed |Added

 CC||ag0ae...@gmail.com

--- Comment #4 from ag0ae...@gmail.com ---
Reduced further:


void f()() { h!()(); }
void g()() { f!()(); }
void h()() { g!()(); }

enum x = is(typeof(g!()()));
alias my_h = h!();

void main() {}


And here's a variant that fails both with and without -debug:


void f()()
{
g!()();
h!()();
}

void g()() { f!()(); }
void h()() { f!()(); }

enum x = is(typeof(f!()()));
alias my_g = g!();

void main() {}


--


[Issue 15985] [REG2.068/2.069] Code doesn't link unless compiled with -debug

2017-10-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15985

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #3 from Walter Bright  ---
Reduced it a bit to:

struct S()
{
void delegate() d;
}

S!() f_Ds(U)()
{
static if (is(U == struct))
return S!()
(
{
foreach (i, field; U.init.tupleof)
f_Ds!(typeof(field))();
}
);

else
return f_Ds!(D)();
}

void f_E()
{
auto f = S!()
(
{
enum x = is(typeof(f_Ds!(D*)()));
f_Ds!(D*)();
}
);
}

struct A
{
D* d;
}

struct D
{
A a;
int b;
}

void main()
{
f_E();
f_Ds!(D*)();
}

--


[Issue 15985] [REG2.068/2.069] Code doesn't link unless compiled with -debug

2017-02-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15985

--- Comment #2 from Vladimir Panteleev  ---
(In reply to Vladimir Panteleev from comment #0)
> Bisection attempts point towards master/stable branch merges (i.e. nothing
> useful).
> 
> It is probably a latent heisenbug triggered by other changes.

Sorry, that was wrong. (Digger could not bisect changes in the stable branch
properly)

Introduced in https://github.com/D-Programming-Language/dmd/pull/4944.

--


[Issue 15985] [REG2.068/2.069] Code doesn't link unless compiled with -debug

2016-05-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15985

j...@red.email.ne.jp changed:

   What|Removed |Added

 CC||j...@red.email.ne.jp

--- Comment #1 from j...@red.email.ne.jp ---
I confirmed this with dmd 2.068 and -m64 mode in Windows.

So -allinst option works.

--