This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
namespace support in 19980628 snapshot
- To: egcs-bugs at cygnus dot com
- Subject: namespace support in 19980628 snapshot
- From: Nathan Sidwell <nathan at cs dot bris dot ac dot uk>
- Date: Wed, 01 Jul 1998 17:41:12 +0100
- Organization: Computer Science Dept, Bristol University
Hi,
How complete is the namespace support in the 19980628 snapshot? I ask,
because the following program doesn't compile.
--begin program
namespace A
{
int a;
}
void f()
{
using namespace A;
a = 7;
}
--end program
the session log is,
--begin session log
nathan@laie:9932>uname -a
SunOS laie 5.5.1 Generic sun4u sparc SUNW,Ultra-1
nathan@laie:9933>egcs-0628-g++ -c foo.cc -v
Reading specs from
/home/staff/nathan/solaris/local/SunOS_5/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.43/specs
gcc version egcs-2.91.43 19980628 (gcc2 ss-980502 experimental)
/home/staff/nathan/solaris/local/SunOS_5/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.43/cpp
-lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus
-D__GNUC_MINOR__=91 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__
-D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix
-Asystem(unix) -Asystem(svr4) -D__EXCEPTIONS -D__GCC_NEW_VARARGS__
-Acpu(sparc) -Amachine(sparc) foo.cc /var/tmp/ccBjzb1G
GNU CPP version egcs-2.91.43 19980628 (gcc2 ss-980502 experimental)
(sparc)
#include "..." search starts here:
#include <...> search starts here:
/home/staff/nathan/solaris/local/include/g++
/usr/local/include
/home/staff/nathan/solaris/local/SunOS_5/sparc-sun-solaris2.5.1/include
/home/staff/nathan/solaris/local/SunOS_5/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.43/include
/usr/include
End of search list.
/home/staff/nathan/solaris/local/SunOS_5/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.43/cc1plus
/var/tmp/ccBjzb1G -quiet -dumpbase foo.cc -version -o /var/tmp/ccMIG5Vl
GNU C++ version egcs-2.91.43 19980628 (gcc2 ss-980502 experimental)
(sparc-sun-solaris2.5.1) compiled by GNU C version 2.8.1.
foo.cc: In function `void f()':
foo.cc:8: parse error before `using'
foo.cc:9: `a' undeclared (first use this function)
foo.cc:9: (Each undeclared identifier is reported only once
foo.cc:9: for each function it appears in.)
--end session log
The snapshot doesn't seem to grok using directives in block scope, which
according to the december96 draft is allowed (7.3.4), and gives just
such an example (para 3) (well actually the example points out a naming
collision, but implies that the above example should work).
Question. Has this ability changed (i.e. are using directive no longer
allowed in block scope)? Or is it a deficiency in the current
(experimental) namespace support?
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
You can up the bandwidth, but you can't up the speed of light
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk