diff --git a/src/dmd/cppmangle.d b/src/dmd/cppmangle.d index 2dc635e128ad..f29d4e95feaa 100644 --- a/src/dmd/cppmangle.d +++ b/src/dmd/cppmangle.d @@ -657,6 +657,19 @@ private final class CppMangleVisitor : Visitor td = new TypeDelegate(td); t = merge(t); } + static if (IN_GCC) + { + // Could be a va_list, which we mangle as a pointer. + if (t.ty == Tsarray && Type.tvalist.ty == Tsarray) + { + Type tb = t.toBasetype().mutableOf(); + if (tb == Type.tvalist) + { + tb = t.nextOf().pointerTo(); + t = tb.castMod(t.mod); + } + } + } if (t.ty == Tsarray) { // Static arrays in D are passed by value; no counterpart in C++