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
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
Comment #3 by github-bugzilla — 2013-02-17T11:36:00Z
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