[C++] namespace alias bug

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Fri May 19 01:36:00 GMT 2000


> This should compile. It doesn't....

Thanks for your bug report. Here is a patch.

Regards,
Martin

// Build don't link:
namespace Foo
{
    enum FooEnum { Hi, Hello, HowAreYou };
}

namespace Foobar
{
    using namespace Foo;
}

namespace FB = Foobar;

void foobar(FB::FooEnum a_foo); 

2000-05-19  Martin v. Löwis  <loewis@informatik.hu-berlin.de>

	* decl2.c (qualified_lookup_using_namespace): Look through
	namespace aliases.

Index: decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.349
diff -u -r1.349 decl2.c
--- decl2.c	2000/05/17 18:46:32	1.349
+++ decl2.c	2000/05/19 08:27:02
@@ -4402,6 +4402,8 @@
   /* ... and a list of namespace yet to see. */
   tree todo = NULL_TREE;
   tree usings;
+  /* Look through namespace aliases.  */
+  scope = ORIGINAL_NAMESPACE (scope);
   while (scope && (result != error_mark_node))
     {
       seen = tree_cons (scope, NULL_TREE, seen);


More information about the Gcc-bugs mailing list