[Issue 6208] New: Parameter storage classes are ignored in template function deducing.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jun 24 09:05:02 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6208
Summary: Parameter storage classes are ignored in template
function deducing.
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: k.hara.pg at gmail.com
--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2011-06-24 09:00:09 PDT ---
In the following code, ref storage class of function foo's parameter s is
ignored.
So calling foo with lvalue makes confusing.
----
int foo(S)(ref S s){ return 1; }
int foo(S)(S s){ return 2; }
void main()
{
int n;
assert(foo(n) == 1); // Line 6
assert(foo(0) == 2);
}
----
test.d(6): Error: template test.foo(S) foo(S) matches more than one template
declaration, test.d(1):foo(S) and test.d(2):foo(S)
----
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list