Bug 24607 – __traits(isDeprecated, ...) result incorrect on an alias member

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-06-14T20:49:45Z
Last change time
2024-12-13T19:35:41Z
Assigned to
No Owner
Creator
apham
Moved to GitHub: dmd#20467 →

Comments

Comment #0 by apz28 — 2024-06-14T20:49:45Z
module test; struct A { int foo() { return 1; } alias bar1 = foo; deprecated("please use foo") alias bar3 = foo; } deprecated("No longer support") struct B { } pragma(msg, __traits(allMembers, A)); pragma(msg, __traits(isDeprecated, A, "foo"))); pragma(msg, __traits(isDeprecated, __traits(getMember, A, "bar3"))); pragma(msg, __traits(isDeprecated, B)); Output AliasSeq!("foo", "bar1", "bar3") false false -> should be true true Should support checking on member pragma(msg, __traits(isDeprecated, A.bar3));
Comment #1 by nick — 2024-06-17T09:52:24Z
> pragma(msg, __traits(isDeprecated, A, "foo"))); The docs say it takes only one argument (like other trait docs), though actually the result is true if both A and "foo" are deprecated. https://dlang.org/spec/traits.html#isDeprecated > Should support checking on member > pragma(msg, __traits(isDeprecated, A.bar3)); That is actually the correct syntax, but the result is false when it should be true. (I am adding a member symbol example in this pull https://github.com/dlang/dlang.org/pull/3851).
Comment #2 by robert.schadek — 2024-12-13T19:35:41Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20467 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB