[Issue 7619] New: Broken deprecated feature with template function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 1 06:00:01 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7619

           Summary: Broken deprecated feature with template function
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            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> 2012-03-01 06:00:00 PST ---
I think following code should compile with and without -d switch.

test.d
----
void main(){}

void foo(T)(T t){}  // line 3

deprecated struct S{}

deprecated void test()
{
    S s;
    foo(s);   // line 10
    // foo is instantiated with deprecated struct S.
}

command line
----
dmd -run test.d

output:
----
test.d(3): Error: struct test.S is deprecated
test.d(10): Error: template instance test.foo!(S) error instantiating

-- 
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