Thread overview
[Issue 5932] Internal error: s2ir.c 339
May 06, 2011
Don
Sep 15, 2011
Don
Sep 20, 2011
Walter Bright
May 06, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5932


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug@yahoo.com.au


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2011-05-06 01:47:34 PDT ---
This is probably related to bug 4910, and also to bug 4269 ("invalid type accepted if evaluated while errors are gagged")

There's a problem with the gagging system.

One difficulty is that if there has been a forward reference, CTFE needs to run
semantic3 on the function. If errors are gagged from inside
VarDeclaration::semantic, the gagging should only apply to CTFE; the semantic3
errors should not be gagged.
The problem is, the gagging system doesn't have any mechanism for ungagging.
If we instantiated a template from inside is(typeof()), semantic errors should
be gagged; we don't yet know if the template will be instantiated. Let's call
this an investigative template instantiation. This is recursive; any template
instantiated from inside a investigative template is also investigative.
BUT, any semantic run on anything other than a investigative template should
NOT be gagged. The simple incrementing and decrementing of global.gag doesn't
quite work.

The other side of the problem is bug 4269: failed templates are not removed. If there is an attempt to instantiate them from a non-gagged state, the original (previously suppressed) error messages should be shown.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 15, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5932


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|D2                          |D1 & D2


--- Comment #2 from Don <clugdbug@yahoo.com.au> 2011-09-15 07:46:34 PDT ---
Reduced test case fails also on D1.070 (again with ICE(s2ir.c).
On D2.054 and later, this test case hits bug 6675 ICE(glue.c) instead.
======

void receive(T)() {
    static assert( 0 );
    get( 7 );
}

void get(T)( T val ) {
    void onStandardMsg() {
        foreach( t; T ) { }
    }
}

static assert(!is(typeof(
    {
        receive!(int)();
    }()
)));

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 20, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5932


Walter Bright <bugzilla@digitalmars.com> changed:

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


--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2011-09-20 13:16:40 PDT ---
https://github.com/D-Programming-Language/dmd/commit/6dc84fd7f2f43d28039d08bf80658cffc97e00f0

https://github.com/D-Programming-Language/dmd/commit/cf7a78423f426fb0d2d62b0af821129f1a4077a1

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