[Issue 7322] Taking address of deprecated functions isn't refused

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 19 08:57:15 PDT 2012


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



--- Comment #4 from Kenji Hara <k.hara.pg at gmail.com> 2012-07-19 08:57:10 PDT ---
(In reply to comment #3)
> If foo(int) instead of foo(float) is deprecated, then an error is issued even
> though it should be possible to take the address of the undeprecated function.
> 
> (I've been having similar problems trying to fix issue 144; in these
> situtations, I think AddrExp::semantic is too early in the compilation process
> for applying fixes that may be affected by overload resolution.)

An example that accidentally rejected with current git head:

deprecated int foo(float a) { return 1; }
int foo(int a) { return 0; }

void main()
{
    int function(float) fp1 = &foo;
    // test.d(10): Error: function test.foo is deprecated  <- Bad!
}

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