Thread overview | ||||||
---|---|---|---|---|---|---|
|
April 26, 2011 [Issue 5890] New: ICE and wrong scope problem for 2nd argument in static assert with DMD on git master | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=5890 Summary: ICE and wrong scope problem for 2nd argument in static assert with DMD on git master Product: D Version: D2 Platform: Other OS/Version: Mac OS X Status: NEW Keywords: ice-on-valid-code, rejects-valid Severity: regression Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: kennytm@gmail.com --- Comment #0 from kennytm@gmail.com 2011-04-26 04:18:40 PDT --- This is a problem on the git master. This does not affect 2.052. The program below causes an ICE on the git master version: ------------------------------------------------- class K { void f() { static assert(0, typeof(this).stringof); } } void main() { (new K).f; } ------------------------------------------------- $ dmd2.052/osx/bin/dmd x # correct x.d(6): Error: static assert "K"c $ dmd x # incorrect Assertion failed: (this != enclosing), function Scope, file scope.c, line 132. Abort trap ------------------------------------------------- And the program below thinks the template parameter U does not exist: ------------------------------------------------- class K { static void f(U)() { static assert(0, U.stringof); } } void main() { K.f!int(); } ------------------------------------------------- $ dmd2.052/osx/bin/dmd x # correct x.d(6): Error: static assert "int"c x.d(11): instantiated from here: f!(int) $ dmd x # incorrect x.d(6): Error: undefined identifier U x.d(6): Error: static assert __error x.d(11): instantiated from here: f!(int) ------------------------------------------------- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 26, 2011 [Issue 5890] ICE and wrong scope problem for 2nd argument in static assert with DMD on git master | ||||
---|---|---|---|---|
| ||||
Posted in reply to kennytm@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=5890 kennytm@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://d.puremagic.com/issu | |es/show_bug.cgi?id=4097 --- Comment #1 from kennytm@gmail.com 2011-04-26 05:02:03 PDT --- Both problems were introduced in commit 7588ca35c5e723a8fccfbfc1db684114aa1e29aa when fixing issue 4097. (https://github.com/D-Programming-Language/dmd/commit/7588ca35c5e723a8fccfbfc1db684114aa1e29aa) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 26, 2011 [Issue 5890] ICE and wrong scope problem for 2nd argument in static assert with DMD on git master | ||||
---|---|---|---|---|
| ||||
Posted in reply to kennytm@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=5890 kennytm@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch --- Comment #2 from kennytm@gmail.com 2011-04-26 05:17:35 PDT --- The fix should be trivial: diff --git a/src/staticassert.c b/src/staticassert.c index 67a1e48..82aad9c 100644 --- a/src/staticassert.c +++ b/src/staticassert.c @@ -57,7 +57,7 @@ void StaticAssert::semantic2(Scope *sc) sc = sc->push(sd); sc->flags |= SCOPEstaticassert; Expression *e = exp->semantic(sc); - sc->pop(); + sc = sc->pop(); if (e->op == TOKerror) return; e = e->optimize(WANTvalue | WANTinterpret); -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 05, 2011 [Issue 5890] ICE and wrong scope problem for 2nd argument in static assert with DMD on git master | ||||
---|---|---|---|---|
| ||||
Posted in reply to kennytm@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=5890 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |FIXED --- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2011-05-05 00:03:12 PDT --- https://github.com/D-Programming-Language/dmd/commit/3fcc2344681ab9d31d1897188f36051c9beb247f -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation