This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: EGCS-1.1.1.prelease-2 BUG (namespace ?)


> EGCS_BUG.C:5: Internal compiler error 382.
> EGCS_BUG.C:5: Please submit a full bug report to `egcs-bugs@cygnus.com'.

Thanks for your bug report. Below is a patch.

> I cannot get this tiny program to compile (or link)  unless I move the
> #include <iomanip>   directive in front of the  namespace statement:

This is exactly what you need to do: You must not include headers of the
standard library while in a namespace, or you will get linker errors;
whether you have using-directives or not.

Hope this helps,
Martin

1998-11-20  Martin von Löwis  <loewis@informatik.hu-berlin.de>

	* decl2.c (validate_nonmember_using_decl): Allow using templates
	from the global namespace.

Index: decl2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl2.c,v
retrieving revision 1.154
diff -c -p -r1.154 decl2.c
*** decl2.c	1998/11/03 17:37:49	1.154
--- decl2.c	1998/11/20 23:00:03
*************** validate_nonmember_using_decl (decl, sco
*** 4688,4694 ****
        *name = TREE_OPERAND (decl, 1);
      }
    else if (TREE_CODE (decl) == IDENTIFIER_NODE
!            || TREE_CODE (decl) == TYPE_DECL)
      {
        *scope = global_namespace;
        *name = decl;
--- 4711,4718 ----
        *name = TREE_OPERAND (decl, 1);
      }
    else if (TREE_CODE (decl) == IDENTIFIER_NODE
!            || TREE_CODE (decl) == TYPE_DECL
! 	   || TREE_CODE (decl) == TEMPLATE_DECL)
      {
        *scope = global_namespace;
        *name = decl;
--- /dev/null	Mon Jul 18 01:46:18 1994
+++ g++.ns/using10.C	Sat Nov 21 00:05:00 1998
@@ -0,0 +1,9 @@
+//Build don't link:
+//Based on a report by Helmut Jarausch <jarausch@IGPM.Rwth-Aachen.DE>
+template<class>
+class foo{};
+
+namespace ABC
+{
+  using ::foo;
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]