Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
Bug 241 - [ICE] imports.cc:46: ImportVisitor::visit
Summary: [ICE] imports.cc:46: ImportVisitor::visit
Status: RESOLVED FIXED
Alias: None
Product: GDC
Classification: Unclassified
Component: gdc (show other bugs)
Version: development
Hardware: All All
: --- normal
Assignee: Iain Buclaw
URL:
Depends on:
Blocks:
 
Reported: 2016-09-18 14:31 CEST by Iain Buclaw
Modified: 2016-10-02 17:00 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Iain Buclaw 2016-09-18 14:31:08 CEST
a.d:1:8: internal compiler error: in visit, at d/imports.cc:46
 import b;
        ^
0x7f3f33 ImportVisitor::visit(Dsymbol*)
	../../dev/gcc/d/imports.cc:46
0x61de17 Visitor::visit(ScopeDsymbol*)
	../../dev/gcc/d/dfrontend/visitor.h:402
0x61e01f Visitor::visit(AggregateDeclaration*)
	../../dev/gcc/d/dfrontend/visitor.h:413
0x61e053 Visitor::visit(StructDeclaration*)
	../../dev/gcc/d/dfrontend/visitor.h:414
0x76c9e3 StructDeclaration::accept(Visitor*)
	../../dev/gcc/d/dfrontend/aggregate.h:196
0x7f4125 ImportVisitor::visit(AliasDeclaration*)
	../../dev/gcc/d/imports.cc:81
0x7f3ebb build_import_decl(Dsymbol*)
	../../dev/gcc/d/imports.cc:148
0x7b5069 Dsymbol::toObjFile()
	../../dev/gcc/d/d-objfile.cc:138
0x7b9c1b Module::genobjfile(bool)
	../../dev/gcc/d/d-objfile.cc:1461
0x7945eb d_parse_file()
	../../dev/gcc/d/d-lang.cc:1244
---

Reduced test:

a.d:
---
import b;
import c : S;
---

b.d
---
import a;
S* s;
---

c.d
---
struct S
{
}
---
Comment 1 Iain Buclaw 2016-09-18 14:34:18 CEST
This happens because AggregateDeclaration inherits from ScopeDsymbol, not Declaration.
Comment 2 Iain Buclaw 2016-10-02 17:00:00 CEST
https://github.com/D-Programming-GDC/GDC/pull/242