This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: namespace problem
- To: vavasis at CS dot Cornell dot EDU
- Subject: Re: namespace problem
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Thu, 24 Sep 1998 00:18:07 +0200
- CC: egcs-bugs at cygnus dot com, egcs-patches at cygnus dot com
- References: <36080412.7AD@cs.cornell.edu>
> 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);