Skip to content

Commit

Permalink
fix Issue 12571 - __traits(parent) should work for typed manifest con…
Browse files Browse the repository at this point in the history
…stant in initializer
  • Loading branch information
9rnsr committed Apr 15, 2014
1 parent d4f778f commit 91bbc5c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/template.c
Expand Up @@ -6493,8 +6493,8 @@ void TemplateInstance::semanticTiargs(Loc loc, Scope *sc, Objects *tiargs, int f
if (ea->op == TOKvar && (v = ((VarExp *)ea)->var->isVarDeclaration()) != NULL &&
!(v->storage_class & STCtemplateparameter))
{
if (v->sem < SemanticDone)
v->semantic(sc);
if (v->sem < SemanticDone && v->scope)
v->semantic(NULL);
// skip optimization for variable symbols
}
else
Expand Down
14 changes: 14 additions & 0 deletions test/runnable/traits.d
Expand Up @@ -1359,6 +1359,20 @@ struct InPlace12278(T)
static assert(__traits(classInstanceSize, T) != 0);
}

/********************************************************/
// 12571

mixin template getScopeName12571()
{
enum string scopeName = __traits(identifier, __traits(parent, scopeName));
}

void test12571()
{
mixin getScopeName12571;
static assert(scopeName == "test12571");
}

/********************************************************/

int main()
Expand Down

0 comments on commit 91bbc5c

Please sign in to comment.