Bug 21825 – DIP1034: Do not spuriously warn "calling XXX without side effects discards return value of type 'noreturn'"

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-04-13T13:33:24Z
Last change time
2021-04-17T14:35:27Z
Keywords
pull
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2021-04-13T13:33:24Z
Comment #1 by dlang-bot — 2021-04-13T13:39:04Z
@n8sh updated dlang/dmd pull request #12430 "DIP1034: make lambdaHasSideEffect true for noreturn functions" fixing this issue: - Fix issue 21825 - DIP1034: make lambdaHasSideEffect true for noreturn functions Prevents spurious warning "calling XXX without side effects discards return value of type `noreturn`; prepend a `cast(void)` if intentional". Also changes the result of hasSideEffect and behavior of isTrivialExp. There appears to be a general inconsistency where a function that performs side-effectful operations may be considered side-effectless but if that is indeed a problem addressing it is beyond the scope of this PR. https://github.com/dlang/dmd/pull/12430
Comment #2 by dlang-bot — 2021-04-17T14:35:27Z
dlang/dmd pull request #12430 "DIP1034: make lambdaHasSideEffect true for noreturn functions" was merged into master: - 89fb1ddecafbdef65522ca83b0cca93b53c086fe by Nathan Sashihara: Fix 21825 - DIP1034: make lambdaHasSideEffect true for noreturn functions Prevents spurious warning "calling XXX without side effects discards return value of type `noreturn`; prepend a `cast(void)` if intentional". Also changes the result of hasSideEffect and behavior of isTrivialExp. There appears to be a general inconsistency where a function that performs side-effectful operations may be considered side-effectless but if that is indeed a problem addressing it is beyond the scope of this PR. https://github.com/dlang/dmd/pull/12430