D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21831 - Wrong deprecation message in template parameters before evaluating constraints
Summary: Wrong deprecation message in template parameters before evaluating constraints
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2021-04-15 17:19 UTC by Iain Buclaw
Modified: 2021-04-16 00:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Iain Buclaw 2021-04-15 17:19:21 UTC
deprecated struct OldStruct { }

struct NewStruct { }

auto foo(T)(T t)    // error: struct `OldStruct` is deprecated
if (!__traits(isDeprecated, T))
{
    return T.init;
}

deprecated auto foo(T)(T t)
if (__traits(isDeprecated, T))
{
    return T.init;
}

deprecated unittest
{
    auto b = foo(OldStruct()); // instantiated from here
}
Comment 1 Dlang Bot 2021-04-15 17:32:04 UTC
@ibuclaw created dlang/dmd pull request #12440 "fix Issue 21831 - Wrong deprecation message in template parameters before evaluating constraints" fixing this issue:

- fix Issue 21831 - Wrong deprecation message in template parameters before evaluating constraints

https://github.com/dlang/dmd/pull/12440
Comment 2 Dlang Bot 2021-04-16 00:32:18 UTC
dlang/dmd pull request #12440 "fix Issue 21831 - Wrong deprecation message in template parameters before evaluating constraints" was merged into master:

- 52466a6deab25cf5314186b329116e4801b741de by Iain Buclaw:
  fix Issue 21831 - Wrong deprecation message in template parameters before evaluating constraints

https://github.com/dlang/dmd/pull/12440