This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: std::terminate
- To: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Subject: Re: std::terminate
- From: Chip Salzenberg <chip at valinux dot com>
- Date: Mon, 29 May 2000 02:40:09 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- References: <200005290856.KAA18643@loewis.home.cs.tu-berlin.de>
According to Martin v. Loewis:
> 2000-05-29 Martin v. Löwis <loewis@informatik.hu-berlin.de>
> * decl.c (build_library_fn_1): Set DECL_CONTEXT.
Beware, build_library_fn_1 is used for both C++ and C linkage.
My patch, copied below, only affects functions with C++ linkage.
2000-05-28 Chip Salzenberg <chip@valinux.com>
* decl.c (build_cp_library_fn): Honor current namespace.
Index: decl.c
diff -u -2 -p -r1.615 decl.c
--- decl.c 2000/05/28 02:58:14 1.615
+++ decl.c 2000/05/29 05:54:00
@@ -6806,5 +6806,6 @@ build_library_fn (name, type)
}
-/* Returns the _DECL for a library function with C++ linkage. */
+/* Returns the _DECL for a library function with C++ linkage
+ in the current namespace (which should be global or std). */
static tree
@@ -6815,4 +6816,6 @@ build_cp_library_fn (name, operator_code
{
tree fn = build_library_fn_1 (name, operator_code, type);
+ if (current_namespace != global_namespace)
+ DECL_CONTEXT (fn) = current_namespace;
TREE_NOTHROW (fn) = TYPE_NOTHROW_P (type);
set_mangled_name_for_decl (fn);
--
Chip Salzenberg - a.k.a. - <chip@valinux.com>
"I wanted to play hopscotch with the impenetrable mystery of existence,
but he stepped in a wormhole and had to go in early." // MST3K