Jump to page: 1 2
Thread overview
[Issue 14147] Compiler crash on identical functions in a single module
Feb 08, 2015
Ketmar Dark
Feb 08, 2015
Kenji Hara
Feb 08, 2015
Kenji Hara
Feb 08, 2015
Kenji Hara
Feb 08, 2015
Kenji Hara
Feb 08, 2015
Kenji Hara
Oct 17, 2015
Kenji Hara
Mar 01, 2018
Seb
Mar 01
Basile-z
Mar 01
Seb
Jul 05
Basile-z
February 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14147

Ketmar Dark <ketmar@ketmar.no-ip.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ketmar@ketmar.no-ip.org

--- Comment #1 from Ketmar Dark <ketmar@ketmar.no-ip.org> ---
seems that this assert() is right, and the code in
`StructDeclaration::semantic()` is missing one check.

here we have a check for the same condition:

    if (type->ty == Tstruct && ((TypeStruct *)type)->sym != this)
    {
        TemplateInstance *ti = ((TypeStruct *)type)->sym->isInstantiated();
        if (ti && isError(ti))
            ((TypeStruct *)type)->sym = this;
    }

seems that second `if` is missing `else` part with `error()`.

--
February 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14147

--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> ---
Reduced test case:

struct S(alias func) { void foo() { func(1); } }

void main()
{
}

pure auto mul(const int[] left, const int[] right)
{
    S!(a => a)().foo();
}

pure auto mul(const int[] left, const int[] right)
{
    S!(a => a)().foo();
}

In the two identical functions, the S!(a => a) will create different instances,
but their mangled names are wrongly identical. Then It makes the internal
compiler error (assertion failure).

--
February 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14147

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All
         Depends on|                            |2789
                 OS|Windows                     |All

--
February 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14147

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice, pull

--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> ---
https://github.com/D-Programming-Language/dmd/pull/4396

--
February 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14147

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |2789

--
February 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14147

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|2789                        |

--
October 17, 2015
https://issues.dlang.org/show_bug.cgi?id=14147

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |15217

--
January 24, 2018
https://issues.dlang.org/show_bug.cgi?id=14147

--- Comment #4 from github-bugzilla@puremagic.com ---
Commit pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/ab47b8b0cf18d14c1ffbc97df6c8fb299971170a Issue 14147 - Compiler crash on identical functions in a single module (#7577)

* fix Issue 2789 - Functions overloads are not checked for conflicts

* Allow an overload declaration hack, which is actually used in druntime

If two extern (C) functions are just declared with different signatures,
they don't conflict.

 extern(C):
 alias sigfn_t  = void function(int);
 alias sigfn_t2 = void function(int) nothrow @nogc;
 sigfn_t  bsd_signal(int sig, sigfn_t  func);
 sigfn_t2 bsd_signal(int sig, sigfn_t2 func) nothrow @nogc;  // no error

This behavior must be reconsidered in the future.

* fix Issue 14147 - Compiler crash on identical functions in a single module

*  Allow an overload declaration hack, which is actually used in druntime

* Fix the testsuite

* PR 4396 Fixup

* Remove duplicate definition in the DMD backend

--
February 08, 2018
https://issues.dlang.org/show_bug.cgi?id=14147
Issue 14147 depends on issue 2789, which changed state.

Issue 2789 Summary: Functions overloads are not checked for conflicts https://issues.dlang.org/show_bug.cgi?id=2789

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
March 01, 2018
https://issues.dlang.org/show_bug.cgi?id=14147
Issue 14147 depends on issue 2789, which changed state.

Issue 2789 Summary: Functions overloads are not checked for conflicts https://issues.dlang.org/show_bug.cgi?id=2789

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--
« First   ‹ Prev
1 2