www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1571] New: const on function parameters not carried through to .di file

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

           Summary: const on function parameters not carried through to .di
                    file
           Product: D
           Version: 2.005
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: bugzilla digitalmars.com


class C;
void foo(const C c);

and compiling with -H gives a .di file that is missing the const.


-- 
Oct 11 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1571


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|wrong-code                  |ice-on-invalid-code, patch
                 CC|                            |clugdbug yahoo.com.au
            Summary|const on function           |Segfault(class.c) const on
                   |parameters not carried      |function parameters not
                   |through to .di file         |carried through to .di file



This now segfaults. crashing ClassDeclaration::toCBuffer on members->dim when
members is null.

With the attached patch, as well as preventing the crash, the correct output is
produced.

Patch: class.c line 735 and 749. should ensure class has members,
before writing the members out!

+if(members){
    buf->writenl();
    buf->writeByte('{');
        buf->writenl();
    for (int i = 0; i < members->dim; i++)
    {
        Dsymbol *s = (Dsymbol *)members->data[i];

        buf->writestring("    ");

        s->toCBuffer(buf, hgs);
        }
        buf->writestring("}");
 +   }    else    buf->writestring(";");

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 10 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1571


Walter Bright <bugzilla digitalmars.com> changed:

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



02:12:56 PDT ---
Fixed dmd 1.048 and 2.033

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