Bug 24699 – [REG2.108] No short-circuit evaluation of mixing template bool argument

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-08-12T13:03:42Z
Last change time
2024-11-16T23:27:11Z
Keywords
industry, pull, rejects-valid
Assigned to
No Owner
Creator
johanengelen

Comments

Comment #0 by johanengelen — 2024-08-12T13:03:42Z
Testcase: ``` mixin template StaticAssertAt(bool cond) { static if (!cond) { pragma(msg, "asd"); } } template foo(T) { enum foo = false; mixin StaticAssertAt!(true || T.tupleof.length == 1); } enum a = foo!ubyte; ``` The test case compiles with 2.107 but not with 2.108. The short-circuit evaluation of || is not happening, thus 2.108 errors with: Error: no property `tupleof` for type `ubyte` https://d.godbolt.org/z/fYYYfhq95
Comment #1 by dkorpel — 2024-08-13T20:01:38Z
Comment #2 by dlang-bot — 2024-08-13T20:30:22Z
@dkorpel created dlang/dmd pull request #16781 "Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing…" fixing this issue: - Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing template bool argument https://github.com/dlang/dmd/pull/16781
Comment #3 by dlang-bot — 2024-08-14T22:47:53Z
dlang/dmd pull request #16781 "Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing…" was merged into stable: - dd409f40f3b280a67b65330c173d3f46d316da7d by Dennis Korpel: Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing template bool argument https://github.com/dlang/dmd/pull/16781
Comment #4 by dlang-bot — 2024-10-07T09:00:26Z
dlang/dmd pull request #16967 "Rebase stable6" was merged into master: - 4b3ce3c145a89ea0611637e59b2b4ec4e6b9822c by Dennis Korpel: Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing template bool argument https://github.com/dlang/dmd/pull/16967
Comment #5 by dlang-bot — 2024-11-16T23:27:11Z
dlang/dmd pull request #17069 "Merge stable" was merged into master: - 636f4d3ba280cff50ced4d553cd34869fd69ba16 by Dennis Korpel: Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing template bool argument https://github.com/dlang/dmd/pull/17069