www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1030] New: ICE one-liner; struct in delegate

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

           Summary: ICE one-liner; struct in delegate
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: default_357-line yahoo.de


The following one-liner causes an ICE in line 0. Verified on GDC .21, .23 and
DMD 1.007:

void main() { void delegate() test={ struct test2 {;} }; }

Greetings, downs


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





------- Comment #1 from thomas-dloop kuehne.cn  2007-03-08 10:30 -------
Added to DStress as
http://dstress.kuehne.cn/nocompile/s/struct_29_A.d
http://dstress.kuehne.cn/run/s/struct_29_B.d


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


bugzilla digitalmars.com changed:

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




------- Comment #2 from bugzilla digitalmars.com  2007-03-19 17:41 -------
Fixed DMD 1.009


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


davidl 126.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |regression
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




------- Comment #3 from davidl 126.com  2007-11-07 21:59 -------
Seems 1.022 doesn't compile this, and 1.009 compiles this?


-- 
Nov 07 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1030





------- Comment #4 from default_357-line yahoo.de  2007-11-08 04:40 -------
(In reply to comment #3)
 Seems 1.022 doesn't compile this, and 1.009 compiles this?
 
Strange. Builds fine on my gdc .24/1.022 under linux/32-bit. --
Nov 08 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1030





------- Comment #5 from davidl 126.com  2007-11-08 19:40 -------
it's http://dstress.kuehne.cn/run/s/struct_29_B.d which can't pass the parse
stage. 

seems dmd need a semicolon in the struct in the delegate. 


-- 
Nov 08 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1030


clugdbug yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |
            Summary|ICE one-liner; struct in    |struct in delegate requires
                   |delegate                    |semicolon




------- Comment #6 from clugdbug yahoo.com.au  2009-04-18 17:33 -------
This is really a totally different bug to the original one, and much less
severe. No longer an ICE -- it's a pretty tiny issue.

void main() {
        void delegate() test = {
                struct test2{}
        }
}
---
fog.d(4): expression expected, not 'struct'
fog.d(4): comma expected separating field initializers
fog.d(5): semicolon expected, not '}'
----


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


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|struct in delegate requires |Delegate literal as
                   |semicolon                   |initializer is confused with
                   |                            |struct initializer
            Version|unspecified                 |1.041




------- Comment #7 from smjg iname.com  2009-04-19 07:29 -------
 fog.d(5): semicolon expected, not '}'
This last message is the one that's correct. A declaration of a variable (which is what test is) always requires a closing semicolon. What's actually happening is that it's trying to parse { struct test2{} } as a struct initializer. Nothing to do with the struct that's actually declared inside. See for yourself: ---------- C:\Users\Stewart\Documents\Programming\D\Tests\bugs>type bz1030a.d void main() { void delegate() test = { struct test2{} }; } C:\Users\Stewart\Documents\Programming\D\Tests\bugs>dmd bz1030a.d bz1030a.d(4): expression expected, not 'struct' bz1030a.d(4): comma expected separating field initializers C:\Users\Stewart\Documents\Programming\D\Tests\bugs>type bz1030b.d void main() { void delegate() test; test = { struct test2{} }; } C:\Users\Stewart\Documents\Programming\D\Tests\bugs>dmd bz1030b.d C:\Users\Stewart\Documents\Programming\D\Tests\bugs> ---------- Since AIUI there's no overlap between what's parseable as a struct init and what's parseable as a delegate literal, there should be little or no problem getting it to work. --
Apr 19 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1030


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au
           Severity|regression                  |normal


--- Comment #8 from Don <clugdbug yahoo.com.au> 2009-09-15 06:36:54 PDT ---
This remaining bug is not a regression. It behaved exactly the same way in
DMD0.175.
Another of these annoying cases where we have two unrelated bugs in the same
report. It should not have been reopened.

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


Don <clugdbug yahoo.com.au> changed:

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


--- Comment #9 from Don <clugdbug yahoo.com.au> 2010-01-18 06:38:18 PST ---
The original bug was fixed in 1.009. The bug reported in the comments is the
same as bug 1371; I'm therefore closing this one.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 18 2010