The original assert expected the type of `__traits(initSymbol)' to be
exactly `const(void[])', but because D strips const from arrays to allow
passing slices as mutable ranges to template functions, so it got turned
into `const(void)[]'.
PR d/123419
gcc/d/ChangeLog:
* expr.cc (ExprVisitor::visit (VarExp *)): Adjust assertion.
gcc/testsuite/ChangeLog:
* gdc.dg/pr123419.d: New test.
{
/* Generate a slice for non-zero initialized aggregates,
otherwise create an empty array. */
- gcc_assert (e->type->isConst ()
+ gcc_assert (e->type->nextOf ()->isConst ()
&& e->type->nextOf ()->ty == TY::Tvoid);
tree type = build_ctype (e->type);
--- /dev/null
+// { dg-do compile }
+struct S123419 {}
+
+void t123419(T)(T _) {}
+
+void f123419()
+{
+ t123419(__traits(initSymbol, S123419));
+}