2011-05-27 Jason Merrill <jason@redhat.com>
+ * mangle.c (mangle_decl_string): Make sure we don't try to mangle
+ templates.
+
PR c++/47049
* semantics.c (maybe_add_lambda_conv_op): Fix COMDAT sharing.
* decl.c (start_preparsed_function): Don't call comdat_linkage for
compiler-generated functions. */
&& !DECL_ARTIFICIAL (decl1));
- if (DECL_INTERFACE_KNOWN (decl1))
+ if (processing_template_decl)
+ /* Don't mess with interface flags. */;
+ else if (DECL_INTERFACE_KNOWN (decl1))
{
tree ctx = decl_function_context (decl1);
DECL_EXTERNAL (decl1) = 0;
if (ctx != NULL_TREE && DECL_DECLARED_INLINE_P (ctx)
- && !processing_template_decl
&& TREE_PUBLIC (ctx))
/* This is a function in a local class in an extern inline
function. */
else if (!finfo->interface_unknown && honor_interface)
{
if (DECL_DECLARED_INLINE_P (decl1)
- || DECL_TEMPLATE_INSTANTIATION (decl1)
- || processing_template_decl)
+ || DECL_TEMPLATE_INSTANTIATION (decl1))
{
DECL_EXTERNAL (decl1)
= (finfo->interface_only
tree saved_fn = NULL_TREE;
bool template_p = false;
+ /* We shouldn't be trying to mangle an uninstantiated template. */
+ gcc_assert (!type_dependent_expression_p (decl));
+
if (DECL_LANG_SPECIFIC (decl) && DECL_USE_TEMPLATE (decl))
{
struct tinst_level *tl = current_instantiation ();