diff --git a/gen/toir.cpp b/gen/toir.cpp index 17d31c27..55f3c88f 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -987,12 +987,12 @@ LLConstant* AddrExp::toConstElem(IRState* p) assert(type->toBasetype()->ty == Tpointer); return DtoBitCast(gep, DtoType(type)); } - else if (e1->op == TOKstructliteral) + else if ( + e1->op == TOKstructliteral || + e1->op == TOKslice) { - // FIXME: is this right? - StructLiteralExp* slexp = (StructLiteralExp*)e1; - LLConstant* lit = slexp->toConstElem(p); - return lit; + error("non-constant expression '%s'", toChars()); + fatal(); } // not yet supported else