Skip to content

Commit

Permalink
fix Issue 13403 - [ICE][2.067Alpha] Internal error: backend\type.c 33…
Browse files Browse the repository at this point in the history
…2 with new package protection extension.
  • Loading branch information
9rnsr committed Sep 1, 2014
1 parent f6c130e commit e3bd264
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/attrib.c
Expand Up @@ -586,7 +586,7 @@ Scope *ProtDeclaration::newScope(Scope *sc)
return createNewScope(sc, sc->stc, sc->linkage, this->protection, 1, sc->structalign);
}

void ProtDeclaration::semantic(Scope* sc)
int ProtDeclaration::addMember(Scope *sc, ScopeDsymbol *sds, int memnum)
{
if (pkg_identifiers)
{
Expand All @@ -596,8 +596,6 @@ void ProtDeclaration::semantic(Scope* sc)
pkg_identifiers = NULL;
}

AttribDeclaration::semantic(sc);

if (protection.kind == PROTpackage && protection.pkg && sc->module)
{
Module *m = sc->module;
Expand All @@ -606,6 +604,8 @@ void ProtDeclaration::semantic(Scope* sc)
error("does not bind to one of ancestor packages of module '%s'",
m->toPrettyChars(true));
}

return AttribDeclaration::addMember(sc, sds, memnum);
}

const char *ProtDeclaration::kind()
Expand Down
2 changes: 1 addition & 1 deletion src/attrib.h
Expand Up @@ -108,9 +108,9 @@ class ProtDeclaration : public AttribDeclaration

Dsymbol *syntaxCopy(Dsymbol *s);
Scope *newScope(Scope *sc);
int addMember(Scope *sc, ScopeDsymbol *sds, int memnum);
const char *kind();
const char *toPrettyChars(bool unused);
void semantic(Scope* sc);
void accept(Visitor *v) { v->visit(this); }
};

Expand Down
5 changes: 5 additions & 0 deletions test/compilable/ice13403.d
@@ -0,0 +1,5 @@
// PERMUTE_ARGS:
// REQUIRED_ARGS: -o-
import imports.ice13403a;

void main() {}
7 changes: 7 additions & 0 deletions test/compilable/imports/ice13403a.d
@@ -0,0 +1,7 @@
module imports.ice13403a;

package(imports):

template BacktrackingMatcher()
{
}

0 comments on commit e3bd264

Please sign in to comment.