summaryrefslogtreecommitdiff
path: root/gcc/d/expr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d/expr.cc')
-rw-r--r--gcc/d/expr.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc
index 61a2b50b149..c683d9da333 100644
--- a/gcc/d/expr.cc
+++ b/gcc/d/expr.cc
@@ -3006,6 +3006,16 @@ public:
this->result_ = var;
}
+ /* Build an uninitialized value, generated from void initializers. */
+
+ void visit (VoidInitExp *e)
+ {
+ /* The front-end only generates these for the initializer of globals.
+ Represent `void' as zeroes, regardless of the type's default value. */
+ gcc_assert (this->constp_);
+ this->result_ = build_zero_cst (build_ctype (e->type));
+ }
+
/* These expressions are mainly just a placeholders in the frontend.
We shouldn't see them here. */