Bug 17096 – many traits accept an invalid parameter count without error

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-01-16T06:15:06Z
Last change time
2021-01-03T22:57:09Z
Assigned to
No Owner
Creator
Basile-z

Comments

Comment #0 by b2.temp — 2017-01-16T06:15:06Z
By error, if you don't know well the spec, this scenario is quite possible: class B{final void foo(){} enum a =__traits(isFinalFunction, B, "foo"); // compiles but wrong result instead of __traits(isFinalFunction, B.foo); // ok
Comment #1 by bitter.taste — 2017-01-16T13:33:46Z
Comment #2 by github-bugzilla — 2017-11-17T22:16:46Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/30e01ba7969ede07e0428132dfbdda9d3ddbe80e Fix issue 17096 - Check the number of arguments given to __trait https://github.com/dlang/dmd/commit/ad70d70153978bd4da878d73b7eca6d713643c60 Merge pull request #7330 from JinShil/fix_17096 Fix issue 17096 - Check the number of arguments given to __trait merged-on-behalf-of: Andrei Alexandrescu <[email protected]>
Comment #3 by github-bugzilla — 2017-12-18T22:57:12Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/30e01ba7969ede07e0428132dfbdda9d3ddbe80e Fix issue 17096 - Check the number of arguments given to __trait https://github.com/dlang/dmd/commit/ad70d70153978bd4da878d73b7eca6d713643c60 Merge pull request #7330 from JinShil/fix_17096
Comment #4 by dlang-bot — 2021-01-03T22:57:09Z
dlang/dmd pull request #12093 "[dmd-cxx] Backport more recent traits to the C++ port" was merged into dmd-cxx: - 1602539c49d80c768d4ba68b7b2300ee3573ac0d by JinShil: [dmd-cxx] Fix issue 17096 - Check the number of arguments given to __trait https://github.com/dlang/dmd/pull/12093