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 problem


> Are namespaces fully implemented in egcs-1.1?  The Cygnus webpage states
> that they are, but my namespace-test program below does not compile. 

Thanks for your bug report. egcs 1.1 has a hack where namespace std is
ignored. Unfortunately, it also ignores using declarations involving
std, instead of interpreting them as 'using ::string'. Here is a patch.

Martin

1998-09-23  Martin von L÷wis  <loewis@informatik.hu-berlin.de>

	* decl2.c (validate_nonmember_using_decl): Fix using-directives of
	std if std is ignored.

Index: decl2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl2.c,v
retrieving revision 1.133
diff -c -p -r1.133 decl2.c
*************** validate_nonmember_using_decl (decl, sco
*** 4716,4723 ****
  {
    if (TREE_CODE (decl) == SCOPE_REF
        && TREE_OPERAND (decl, 0) == std_node)
!     return NULL_TREE;
!   if (TREE_CODE (decl) == SCOPE_REF)
      {
        *scope = TREE_OPERAND (decl, 0);
        *name = TREE_OPERAND (decl, 1);
--- 4739,4749 ----
  {
    if (TREE_CODE (decl) == SCOPE_REF
        && TREE_OPERAND (decl, 0) == std_node)
!     {
!       *scope = global_namespace;
!       *name = TREE_OPERAND (decl, 1);
!     }
!   else if (TREE_CODE (decl) == SCOPE_REF)
      {
        *scope = TREE_OPERAND (decl, 0);
        *name = TREE_OPERAND (decl, 1);



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