2012/2/11 Martin Nowak <[email protected]>: > On Sat, 11 Feb 2012 13:13:33 +0100, kenji hara <[email protected]> wrote: > >> Posted a pull. Walter, please merge it. >> https://github.com/D-Programming-Language/dmd/pull/709 >> >> 2012/2/11 Martin Nowak <[email protected]>: >>> >>> While this will solve the current problem, the following code will remain >>> broken. >>> The root cause is contradicting preferences for variadic templates >>> in deduceFunctionTemplateMatch and leastAsSpecialized. >>> >>> void foo(V)(in V v) // A >>> { >>> } >>> >>> void foo(Args...)(auto ref const Args args) // B >>> { >>> foo(cast(const(int))args[0]); >>> } >>> >>> void main() >>> { >>> foo(10); >>> } >> >> >> What is "remain broken"? With my pull, foo(10) calls non variadic >> version (A) as expected. >> > No your fix seems correct. > B with foo(10) should have been MATCHconst due to const Args. > > I thought you would make a change because the inner call passes an lvalue.
In this case, `auto ref` in B is no meaning, because both `in V` and `auto ref const Args` match to both lvalue and rvalue. Kenji Hara _______________________________________________ dmd-beta mailing list [email protected] http://lists.puremagic.com/mailman/listinfo/dmd-beta
