Disallow delegates to static functions.

This commit is contained in:
Christian Kamm
2008-07-29 12:49:14 +02:00
parent c6e0dd9be3
commit dd8982db1f

View File

@@ -1828,6 +1828,9 @@ DValue* DelegateExp::toElem(IRState* p)
Logger::print("DelegateExp::toElem: %s | %s\n", toChars(), type->toChars());
LOG_SCOPE;
if(func->isStatic())
error("can't take delegate of static function %s, it does not require a context ptr", func->toChars());
const LLPointerType* int8ptrty = getPtrToType(LLType::Int8Ty);
LLValue* lval = new llvm::AllocaInst(DtoType(type), "tmpdelegate", p->topallocapoint());