Bug 12697 – -inline ICE backend\el.c 802

Status
RESOLVED
Resolution
WORKSFORME
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-05-03T13:25:13Z
Last change time
2018-02-23T10:05:27Z
Keywords
ice
Assigned to
No Owner
Creator
Temtaime

Comments

Comment #0 by temtaime — 2014-05-03T13:25:13Z
Dustmited from 14k lines. Compile with -inline struct BinaryReader(Reader) { ref read(E)(E e) { auto info = `%s:%u`; readWriteVariable!true(e, E.stringof, e, info); } ref opBinary(string op: `>>`, E)(E e) { read!()(e); } void readWriteVariable(bool isRead, T, P)(T , string , P , string ) { if(isRead) enum defIdx = `default`; } } class GameHandler { private: mixin PacketManager; mixin PacketsHandlers; } struct NetReader { } template PacketManager() { public: alias PacketReader = BinaryReader!NetReader; struct SenderReader { ref opBinary(string op: `>>`, T)(T t) { *r >> t; } PacketReader *r; } SenderReader net() { return SenderReader(); } } struct AuthFail { } template PacketsHandlers() { package: void onAuthFail() { AuthFail data; net >> data; } }
Comment #1 by mk — 2015-04-13T23:41:43Z
This now gives error (with -inline only): Error: true && (enum string defIdx = "default"; ) is not an lvalue
Comment #2 by yoplitein — 2015-11-10T19:10:36Z
My own reduction, compiled with -release -inline -O -lib: void foo() { void delegate() test; bar(test); } auto bar(Delegate, Args...)(Delegate deleg, Args args) { if(deleg) return deleg(args); else { alias problematicAlias = void; return; } } Interestingly, it seems to be caused by the alias.
Comment #3 by slavo5150 — 2018-02-23T10:05:27Z
I cannot reproduce this in 2.078.1 or master (80b606e11c53ef5b55196c83561e635471936f90) on 2018-02-23. Closing as WORKSFORME.