Bug 9790 – Internal error when compiling a invalid variable in template (in expression.c and backend\evalu8.c)

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-23T06:55:00Z
Last change time
2013-03-30T21:52:51Z
Keywords
accepts-invalid, ice, pull
Assigned to
nobody
Creator
enjouzensyou.boinc

Comments

Comment #0 by enjouzensyou.boinc — 2013-03-23T06:55:07Z
/** NG *DMD version : git 8f9fe3b (https://github.com/D-Programming-Language/dmd/commit/8f9fe3ba2dbeae16effc52310ed8ab82bf5af5fc) e = 00478AC0, ty = 35 _error_ 00A5C680 e = 00478AC0, ty = 35 _error_ 00A5C680 Internal error: backend\evalu8.c 279 *DMD version : 2.062 Assertion failure: '0' on line 2178 in file 'expression.c' */ template foo() { enum bool _foo = _Unused_._unused_; enum bool foo = _foo; } /** OK : (Compile Error) C:\d_programming\dtest.d(29): Error: undefined identifier _Unused_ C:\d_programming\dtest.d(35): Error: template instance dtest.bar!() error instantiating */ template bar() { enum bool bar = _Unused_._unused_; } unittest{ assert(foo!()); //assert(bar!()); }
Comment #1 by k.hara.pg — 2013-03-26T08:56:52Z
Comment #2 by github-bugzilla — 2013-03-30T16:20:23Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ed0f8b803a8677bf099810d62f2cc85954d2cc3b fix Issue 9790 - Internal error when compiling a invalid variable in template 1. Remove gagging in VarDeclaration::semantic 2. Commit type in StructLiteralExp::castTo like as StringExp and NullExp It's necessary to avoid std.traits unittest breaking.