Bug 23914 – "auto ref" resolution on return value prevented by noreturn (bottom type)

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-05-12T12:28:13Z
Last change time
2023-05-19T07:54:29Z
Keywords
pull
Assigned to
No Owner
Creator
Vladimir Panteleev

Comments

Comment #0 by dlang-bugzilla — 2023-05-12T12:28:13Z
///////////// test.d ///////////// struct NC { @disable this(this); } struct S { NC nc; auto ref fun() { if (true) return nc; else return assert(false); } } ////////////////////////////////// Compiler says: test.d(9): Error: struct `test.NC` is not copyable because it has a disabled postblit Looks like it prevented "auto ref" from being resolved into "ref", even though explicitly returning by ref seems to work.
Comment #1 by maxhaton — 2023-05-12T13:39:12Z
Isn't `auto ref` for template function parameters only?
Comment #2 by dlang-bugzilla — 2023-05-12T14:09:12Z
No.
Comment #3 by dlang-bot — 2023-05-16T11:10:57Z
@RazvanN7 created dlang/dmd pull request #15240 "Fix Issue 23914 - auto ref resolution on return value prevented by noreturn" fixing this issue: - Fix Issue 23914 - auto ref resolution on return value prevented by noreturn https://github.com/dlang/dmd/pull/15240
Comment #4 by dlang-bot — 2023-05-19T07:54:29Z
dlang/dmd pull request #15240 "Fix Issue 23914 - auto ref resolution on return value prevented by noreturn" was merged into master: - 883de397fb3a1405bdfaaa985abc905049c41fb0 by RazvanN7: Fix Issue 23914 - auto ref resolution on return value prevented by noreturn https://github.com/dlang/dmd/pull/15240