Commit 08225de7 authored by Matthias Klose's avatar Matthias Klose

Revert:

  * Fix PR d/89041, taken from the trunk. Closes: #914470.
parent 14978cd0
......@@ -8,7 +8,6 @@ gcc-8 (8.3.0-7) UNRELEASED; urgency=medium
PR tree-optimization/90018, PR target/90024 (ARM),
PR target/89945 (ARM), PR fortran/87352, PR fortran/89981,
PR fortran/89904, PR libgfortran/79540, PR fortran/87127.
* Fix PR d/89041, taken from the trunk. Closes: #914470.
* Fix PR c++/90050, always link with libstdc++fs.a. LP: #1824721.
-- Matthias Klose <doko@debian.org> Thu, 25 Apr 2019 12:00:45 +0200
......
# DP: Fix PR d/89041, taken from the trunk.
gcc/d/
2019-03-09 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/89041
* d-codegen.cc (get_frame_for_symbol): Delegate literals defined in
global scope don't have a frame pointer.
gcc/testsuite/
2019-03-09 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/89041
* gdc.dg/pr89041.d: New test.
--- a/src/gcc/d/d-codegen.cc
+++ b/src/gcc/d/d-codegen.cc
@@ -2158,15 +2158,25 @@ get_frame_for_symbol (Dsymbol *sym)
fdparent = (FuncDeclaration *) sym;
}
- gcc_assert (fdparent != NULL);
+ /* Not a nested function, there is no frame pointer to pass. */
+ if (fdparent == NULL)
+ {
+ /* Only delegate literals report as being nested, even if they are in
+ global scope. */
+ gcc_assert (fd && fd->isFuncLiteralDeclaration ());
+ return null_pointer_node;
+ }
+
+ gcc_assert (thisfd != NULL);
if (thisfd != fdparent)
{
/* If no frame pointer for this function. */
if (!thisfd->vthis)
{
- sym->error ("is a nested function and cannot be accessed from %s",
- thisfd->toChars ());
+ error_at (make_location_t (sym->loc),
+ "%qs is a nested function and cannot be accessed from %qs",
+ fd->toPrettyChars (), thisfd->toPrettyChars ());
return null_pointer_node;
}
--- /dev/null
+++ b/src/gcc/testsuite/gdc.dg/pr89041.d
@@ -0,0 +1,13 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89041
+module pr89041;
+
+enum dg = delegate {};
+
+void fn()
+{
+ auto var = dg;
+
+ auto inner() {
+ return dg();
+ }
+}
......@@ -80,7 +80,6 @@ debian_patches += \
pr89412 \
pr87808 \
pr88419-revert \
pr89041 \
pr90050 \
# FIXME: see #915194
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment