aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2018-06-01 16:49:33 -0400
committerJason Merrill <jason@gcc.gnu.org>2018-06-01 16:49:33 -0400
commit7d072b977b02c2cea83d8a87c87af6fa89245606 (patch)
tree960feae2c730bd9de62a7905f02f98538ad474e5
parent9760467ea54b39d18a6e0e1e245e5154f24b8ca6 (diff)
downloadgcc-7d072b977b02c2cea83d8a87c87af6fa89245606.zip
gcc-7d072b977b02c2cea83d8a87c87af6fa89245606.tar.gz
gcc-7d072b977b02c2cea83d8a87c87af6fa89245606.tar.bz2
PR c++/58281 - explicit instantiation of constexpr
* pt.c (mark_decl_instantiated): Clear DECL_EXTERNAL. From-SVN: r261085
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 220b80b..ec827c2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-01 Jason Merrill <jason@redhat.com>
+
+ PR c++/58281 - explicit instantiation of constexpr
+ * pt.c (mark_decl_instantiated): Clear DECL_EXTERNAL.
+
2018-05-31 Jason Merrill <jason@redhat.com>
* pt.c (instantiate_decl): Any defaulted function is defined.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index b97cd30..4c5890d 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -22168,6 +22168,12 @@ mark_decl_instantiated (tree result, int extern_p)
linkonce sections. */
else if (TREE_PUBLIC (result))
maybe_make_one_only (result);
+ if (TREE_CODE (result) == FUNCTION_DECL
+ && DECL_TEMPLATE_INSTANTIATED (result))
+ /* If the function has already been instantiated, clear DECL_EXTERNAL,
+ since start_preparsed_function wouldn't have if we had an earlier
+ extern explicit instantiation. */
+ DECL_EXTERNAL (result) = 0;
}
/* If EXTERN_P, then this function will not be emitted -- unless