mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-05 09:31:03 +03:00
Allow member function address as constant initializer
This is allowed since D v2.105. Fixes dmd-testsuite's runnable/test20687.d. Kindly got a heads-up early: https://github.com/dlang/dmd/pull/10958#issuecomment-1471147790
This commit is contained in:
parent
fda89c1c63
commit
12286284cd
1 changed files with 0 additions and 8 deletions
|
@ -1609,14 +1609,6 @@ DValue *DtoSymbolAddress(const Loc &loc, Type *type, Declaration *decl) {
|
|||
}
|
||||
|
||||
llvm::Constant *DtoConstSymbolAddress(const Loc &loc, Declaration *decl) {
|
||||
// Make sure 'this' isn't needed.
|
||||
// TODO: This check really does not belong here, should be moved to
|
||||
// semantic analysis in the frontend.
|
||||
if (decl->needThis()) {
|
||||
error(loc, "need `this` to access `%s`", decl->toChars());
|
||||
fatal();
|
||||
}
|
||||
|
||||
// global variable
|
||||
if (VarDeclaration *vd = decl->isVarDeclaration()) {
|
||||
if (!vd->isDataseg()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue