[Issue 4499] calls to @disabled postblit are emitted
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Feb 26 22:36:14 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4499
Kenji Hara <k.hara.pg at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |k.hara.pg at gmail.com
Platform|Other |All
OS/Version|Linux |All
--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2011-02-26 22:33:22 PST ---
Following patch fixes this bug.
src/s2ir.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/s2ir.c b/src/s2ir.c
index 08d802b..95991b6 100644
--- a/src/s2ir.c
+++ b/src/s2ir.c
@@ -1252,6 +1252,10 @@ void ReturnStatement::toIR(IRState *irs)
{ StructDeclaration *sd = ((TypeStruct *)tb)->sym;
if (sd->postblit)
{ FuncDeclaration *fd = sd->postblit;
+ if (fd->storage_class & STCdisable)
+ {
+ fd->toParent()->error(loc, "is not copyable
because it is annotated with @disable");
+ }
elem *ec = el_var(irs->shidden);
ec = callfunc(loc, irs, 1, Type::tvoid, ec,
tb->pointerTo(), fd, fd->type, NULL, NULL);
es = el_bin(OPcomma, ec->Ety, es, ec);
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list