mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-28 01:23:14 +01:00
Disallow delegates to static functions.
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user