Bug 9525 – [CTFE] Cannot convert &S to const(S*) at compile time
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-17T02:02:00Z
Last change time
2013-02-17T12:38:40Z
Keywords
CTFE, pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg
Comments
Comment #0 by verylonglogin.reg — 2013-02-17T02:02:02Z
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));
}
---
Comment #1 by k.hara.pg — 2013-02-17T03:27:46Z
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
Comment #2 by github-bugzilla — 2013-02-17T11:34:09Z