aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/d/ChangeLog6
-rw-r--r--gcc/d/decl.cc5
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gdc.dg/pr89042a.d2
-rw-r--r--gcc/testsuite/gdc.dg/pr89042b.d2
5 files changed, 20 insertions, 1 deletions
diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog
index 7014b21..151fe1c 100644
--- a/gcc/d/ChangeLog
+++ b/gcc/d/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-26 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/89042
+ * decl.cc (DeclVisitor::visit(VarDeclaration)): Don't assert if
+ handling a void initialized manifest constant.
+
2019-01-21 Iain Buclaw <ibuclaw@gdcproject.org>
* d-frontend.cc (Compiler::paintAsType): Update for new signature.
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index aba1abb..7edfe52 100644
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -593,8 +593,11 @@ public:
if (d->isInstantiated ())
return;
+ /* Cannot make an expression out of a void initializer. */
+ if (!d->_init || d->_init->isVoidInitializer ())
+ return;
+
tree decl = get_symbol_decl (d);
- gcc_assert (d->_init && !d->_init->isVoidInitializer ());
Expression *ie = initializerToExpression (d->_init);
/* CONST_DECL was initially intended for enumerals and may be used for
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d6f6e0f..f1e89d5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-26 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/89042
+ * gdc.dg/pr89042a.d: New test.
+ * gdc.dg/pr89042b.d: New test.
+
2019-01-26 Harald Anlauf <anlauf@gmx.de>
PR fortran/57553
diff --git a/gcc/testsuite/gdc.dg/pr89042a.d b/gcc/testsuite/gdc.dg/pr89042a.d
new file mode 100644
index 0000000..42e05ae
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr89042a.d
@@ -0,0 +1,2 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89042
+enum void[] a = void;
diff --git a/gcc/testsuite/gdc.dg/pr89042b.d b/gcc/testsuite/gdc.dg/pr89042b.d
new file mode 100644
index 0000000..73a1c6e
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr89042b.d
@@ -0,0 +1,2 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89042
+enum void[2] a = void;