* decl.c (build_cp_library_fn): Set DECL_CONTEXT.
* method.c (mangle_expression): Adjust test for legal expression
operators.
* pt.c (instantiate_decl): Save and restore the local
specializations list.
From-SVN: r34302
+2000-05-31 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (build_cp_library_fn): Set DECL_CONTEXT.
+
+ * method.c (mangle_expression): Adjust test for legal expression
+ operators.
+
+ * pt.c (instantiate_decl): Save and restore the local
+ specializations list.
+
2000-05-30 Jason Merrill <jason@decepticon.cygnus.com>
* decl.c (grok_reference_init): Pass LOOKUP_ONLYCONVERTING.
{
tree fn = build_library_fn_1 (name, operator_code, type);
TREE_NOTHROW (fn) = TYPE_NOTHROW_P (type);
+ DECL_CONTEXT (fn) = FROB_CONTEXT (current_namespace);
set_mangled_name_for_decl (fn);
make_function_rtl (fn);
return fn;
const char *name;
name = operator_name_info[TREE_CODE (value)].mangled_name;
- my_friendly_assert (name != NULL, 0);
- if (name[0] != '_' || name[1] != '_')
+ if (name == NULL)
/* On some erroneous inputs, we can get here with VALUE a
- LOOKUP_EXPR. In that case, the NAME will be the
- identifier for "<invalid operator>". We must survive
- this routine in order to issue a sensible error
- message, so we fall through to the case below. */
+ LOOKUP_EXPR. We must survive this routine in order to issue
+ a sensible error message, so we fall through to the case
+ below. */
goto bad_value;
for (i = 0; i < operands; ++i)
}
else if (TREE_CODE (d) == FUNCTION_DECL)
{
+ htab_t saved_local_specializations;
+
+ /* Save away the current list, in case we are instantiating one
+ template from within the body of another. */
+ saved_local_specializations = local_specializations;
+
/* Set up the list of local specializations. */
- my_friendly_assert (local_specializations == NULL, 20000422);
local_specializations = htab_create (37,
htab_hash_pointer,
htab_eq_pointer,
/* We don't need the local specializations any more. */
htab_delete (local_specializations);
- local_specializations = NULL;
+ local_specializations = saved_local_specializations;
/* Finish the function. */
expand_body (finish_function (0));
--- /dev/null
+// Build don't link:
+// Special g++ Options: -O
+// Origin: Mark Mitchell <mitchell@codesourcery.com>
+
+template <class T>
+struct S {
+ inline ~S () {}
+};
+
+template <class T>
+void f ()
+{
+ static S<T> s;
+}
+
+template void f<int>();