www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1078] New: Frontend uses of 'auto' where 'scope' should be used

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

           Summary: Frontend uses of 'auto' where 'scope' should be used
           Product: D
           Version: 1.009
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic, patch
          Severity: minor
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: deewiant gmail.com


Instances in the frontend where error messages say "auto" when they should say
"scope":

declaration.c, lines 755 and 761. Code showcase:

scope class Foo {}
Foo f;

expression.c, line 3175. Code showcase:

void main() {
        scope f = new Object;
        return f;
}

func.c, line 135. Code showcase:

scope void main() {}

mtype.c, line 2680. Code showcase:

scope class Foo {}
Foo foo();


-- 
Mar 22 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1078






Realized that it might be easier to fix in a development version of DMD if I
gave you the lines as well as the line numbers...

declaration.c, 755: error("globals, statics, fields, inout and out parameters
cannot be auto");
declaration.c, 761: error("reference to auto class must be auto");
expression.c, 3175: error("escaping reference to auto local %s", v->toChars());
func.c, 135: error("functions cannot be const or auto");
mtype.c, 2680: error(loc, "functions cannot return auto %s", next->toChars());


-- 
Mar 22 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1078






*** Bug 518 has been marked as a duplicate of this bug. ***


-- 
Mar 23 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1078






func.c, line 135 should actually probably say "const, auto, or scope" since the
error is generated also for code like the following:

auto void main() {}


-- 
Mar 23 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1078


clugdbug yahoo.com.au changed:

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





Fixed DMD2.023


-- 
Apr 03 2009