aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-11-11 22:31:29 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-11-11 22:31:29 +0100
commit48042bd43e0b0407748a110ef8e917827f0fe422 (patch)
treeafe20565959e1676a84de50466c70c5055c2a617 /gcc/cp
parent4f67832ee1e9929d76bc05cd5daa1c2cf12d0dd0 (diff)
downloadgcc-48042bd43e0b0407748a110ef8e917827f0fe422.zip
gcc-48042bd43e0b0407748a110ef8e917827f0fe422.tar.gz
gcc-48042bd43e0b0407748a110ef8e917827f0fe422.tar.bz2
re PR c++/92447 (ICE in poplevel, at cp/decl.c:585)
PR c++/92447 * decl.c (finish_function): Move ctype initialization before DECL_DELETED_FN handling. * g++.dg/cpp0x/pr92447.C: New test. From-SVN: r278068
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/decl.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 81811a4..a5bc9d4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2019-11-11 Jakub Jelinek <jakub@redhat.com>
+ PR c++/92447
+ * decl.c (finish_function): Move ctype initialization before
+ DECL_DELETED_FN handling.
+
* semantics.c (finish_translation_unit): Diagnose declare target
without corresponding end declare target.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 5c5a85e..caa04af 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -16803,6 +16803,10 @@ finish_function (bool inline_p)
}
}
+ /* Remember that we were in class scope. */
+ if (current_class_name)
+ ctype = current_class_type;
+
if (DECL_DELETED_FN (fndecl))
{
DECL_INITIAL (fndecl) = error_mark_node;
@@ -16861,10 +16865,6 @@ finish_function (bool inline_p)
current_function_return_value = NULL_TREE;
}
- /* Remember that we were in class scope. */
- if (current_class_name)
- ctype = current_class_type;
-
/* Must mark the RESULT_DECL as being in this function. */
DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl;