Thread overview
[Issue 9525] New: [CTFE] Cannot convert &S to const(S*) at compile time
Feb 17, 2013
Denis Shelomovskij
Feb 17, 2013
Kenji Hara
Feb 17, 2013
Walter Bright
February 17, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9525

           Summary: [CTFE] Cannot convert &S to const(S*) at compile time
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: CTFE, rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: verylonglogin.reg@gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2013-02-17 13:02:02 MSK ---
This code used to work in 2.061:
---
void f(T)(in T*) { }

void main()
{
    void test(alias a)()
    {
        static struct S { }
        S s;
        a(&s); // Error: Cannot convert &S to const(S*) at compile time
    }
    static assert((test!f(), true));
}
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 17, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9525


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2013-02-17 03:27:46 PST ---
This bug is introduced by fixing bug 8504.
----
Revision: 6344a72ac2e2e597110891f7aed4b998d58f61fd
Author: Martin Nowak
Date: 2013年1月23日 2:29:57
Message:
Merge pull request #1096 from 9rnsr/fix8504

Issue 8504 - Template attribute inferrence doesn't work
----

By fixing issue 8504, template attribute inference affects mangled name for instantiated function.

On the other hand, the function local struct S should have independent mangled name from the inference, but it had accidentally affected. Finally, internal type equality check had wrongly failed.

From the implementation detail, the bug mechanism is very similar with bug 8847. Both are caused by unintended mangled name changing.

https://github.com/D-Programming-Language/dmd/pull/1669

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 17, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9525



--- Comment #2 from github-bugzilla@puremagic.com 2013-02-17 11:34:09 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/f299278adc40385730ed842664b71d92662e76dc fix Issue 9525 - [CTFE] Cannot convert &S to const(S*) at compile time

https://github.com/D-Programming-Language/dmd/commit/2a6666541e0bcfd7491c721a8d11df5556dd4860 Merge pull request #1669 from 9rnsr/fix9525

[Regression 2.062alpha] Issue 9525 - [CTFE] Cannot convert &S to const(S*) at
compile time

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 17, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9525



--- Comment #3 from github-bugzilla@puremagic.com 2013-02-17 11:36:00 PST ---
Commit pushed to staging at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/0ac44a7c31ce4b426bea608bd3679277b98ae4a7 Merge pull request #1669 from 9rnsr/fix9525

[Regression 2.062alpha] Issue 9525 - [CTFE] Cannot convert &S to const(S*) at
compile time

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 17, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9525


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------