www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 867] New: Error messages refer to _dtor instead of ~this

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=867

           Summary: Error messages refer to _dtor instead of ~this
           Product: D
           Version: 1.00
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: deewiant gmail.com


class Foo { abstract ~this(); }

The above generates "function asdf.Foo._dtor non-virtual functions cannot be
abstract". That should read "asdf.Foo.~this".

class Foo { auto ~this(); }

The above is similar: "function asdf.Foo._dtor functions cannot be const or
auto". With const the behaviour is, of course, the same.

However, a leftover from before "scope" is the following:

class Foo { scope ~this(); }

This emits "function asdf.Foo._dtor functions cannot be const or auto" as well.
This should say something about scope.


-- 
Jan 21 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=867


clugdbug yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch





The 'scope' error has already been fixed for D2, but not for D1.

This simple patch changes  __dtor into ~this, by analogy to how it's done for
constructors.


Index: declaration.h
===================================================================
--- declaration.h       (revision 21)
+++ declaration.h       (working copy)
   -661,6 +661,8   
     Dsymbol *syntaxCopy(Dsymbol *);
     void semantic(Scope *sc);
     void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
+    const char *kind();
+    char *toChars();
     int isVirtual();
     int addPreInvariant();
     int addPostInvariant();
Index: func.c
===================================================================
--- func.c      (revision 21)
+++ func.c      (working copy)
   -2592,6 +2592,16   
     return FALSE;
 }

+const char *DtorDeclaration::kind()
+{      
+    return "destructor";
+}
+
+char *DtorDeclaration::toChars()
+{
+    return (char *)"~this";
+}
+
 int DtorDeclaration::isVirtual()
 {
     /* This should be FALSE so that dtor's don't get put into the vtbl[],


-- 
Apr 01 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=867






Created an attachment (id=309)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=309&action=view)
D2 patch for 867


-- 
Apr 01 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=867


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



22:52:14 PDT ---
This seems to have been fixed for a while now...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 13 2009