From: Jason Merrill Date: Fri, 1 Jun 2018 20:49:33 +0000 (-0400) Subject: PR c++/58281 - explicit instantiation of constexpr X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7d072b977b02c2cea83d8a87c87af6fa89245606;p=gcc.git PR c++/58281 - explicit instantiation of constexpr * pt.c (mark_decl_instantiated): Clear DECL_EXTERNAL. From-SVN: r261085 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 220b80b4098..ec827c25108 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-06-01 Jason Merrill + + PR c++/58281 - explicit instantiation of constexpr + * pt.c (mark_decl_instantiated): Clear DECL_EXTERNAL. + 2018-05-31 Jason Merrill * pt.c (instantiate_decl): Any defaulted function is defined. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b97cd3013be..4c5890deeb8 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