Mercurial > projects > ldc
comparison gen/toir.cpp @ 1497:d9d50163e1a4
Cannot take the address of a slice or struct literal as a constant expression.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 14 Jun 2009 12:27:51 +0200 |
parents | b4fc62f047cd |
children | cc5fee7836dc |
comparison
equal
deleted
inserted
replaced
1496:b4fc62f047cd | 1497:d9d50163e1a4 |
---|---|
985 | 985 |
986 // bitcast to requested type | 986 // bitcast to requested type |
987 assert(type->toBasetype()->ty == Tpointer); | 987 assert(type->toBasetype()->ty == Tpointer); |
988 return DtoBitCast(gep, DtoType(type)); | 988 return DtoBitCast(gep, DtoType(type)); |
989 } | 989 } |
990 else if (e1->op == TOKstructliteral) | 990 else if ( |
991 { | 991 e1->op == TOKstructliteral || |
992 // FIXME: is this right? | 992 e1->op == TOKslice) |
993 StructLiteralExp* slexp = (StructLiteralExp*)e1; | 993 { |
994 LLConstant* lit = slexp->toConstElem(p); | 994 error("non-constant expression '%s'", toChars()); |
995 return lit; | 995 fatal(); |
996 } | 996 } |
997 // not yet supported | 997 // not yet supported |
998 else | 998 else |
999 { | 999 { |
1000 Lerr: | 1000 Lerr: |