diff --git a/src/toctype.c b/src/toctype.c index d3002d34b861..8ddaf9d7bd74 100644 --- a/src/toctype.c +++ b/src/toctype.c @@ -106,10 +106,13 @@ class ToCtypeVisitor : public Visitor Type *tm = t->mutableOf(); if (tm->ctype) { - Symbol *s = tm->ctype->Ttag; - t->ctype = type_alloc(TYstruct); - t->ctype->Ttag = (Classsym *)s; // structure tag name + t->ctype = type_alloc(tybasic(tm->ctype->Tty)); t->ctype->Tcount++; + if (t->ctype->Tty == TYstruct) + { + Symbol *s = tm->ctype->Ttag; + t->ctype->Ttag = (Classsym *)s; // structure tag name + } // Add modifiers switch (t->mod) { diff --git a/test/runnable/cppa.d b/test/runnable/cppa.d index 13ce92292e5a..b18fc9a1f08c 100644 --- a/test/runnable/cppa.d +++ b/test/runnable/cppa.d @@ -1,3 +1,4 @@ +// PERMUTE_ARGS: -g // EXTRA_CPP_SOURCES: cppb.cpp import core.stdc.stdio;