This is the mail archive of the gcc-patches@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: namespace alias and using directive


> Is this a bug, or more C++ namespace weirdness?

I'd say this is a bug. Here is a patch.

Thanks,
Martin

1999-02-22  Martin von Loewis  <loewis@informatik.hu-berlin.de>

	* decl.c (lookup_namespace_name): Resolve namespace aliases.

//Build don't link:
namespace A{
  namespace B{int i;}
  using namespace B;
}

namespace C=A;

void f(){
  C::i = 1;
}

Index: decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.312
diff -u -p -r1.312 decl.c
--- decl.c	1999/02/21 16:38:14	1.312
+++ decl.c	1999/02/22 17:54:20
@@ -5029,6 +5029,8 @@ lookup_namespace_name (namespace, name)
       return error_mark_node;
     }
 
+  namespace = ORIGINAL_NAMESPACE (namespace);
+
   my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 373);
   
   val = binding_init (&_b);



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