This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
confusing name lookup diagnostic (cvs g++ 20000306)
- To: bug-gcc at gnu dot org
- Subject: confusing name lookup diagnostic (cvs g++ 20000306)
- From: scott snyder <snyder at fnal dot gov>
- Date: Wed, 08 Mar 2000 20:54:21 CST
hi -
gcc (cvs version 2.96 20000306 on i686-pc-linux-gnu) gives a particularly
confusing diagnostic for the following input (which i believe to be invalid).
-- egcsbug9.cc -------------------------------------------------------------
class CftCluster {};
namespace d0track {
typedef CftCluster CftCluster;
}
using namespace d0track;
void foo () {
CftCluster cftclus;
}
----------------------------------------------------------------------------
I think that this input is invalid because the reference to `CftCluster'
is ambiguous -- it can be found in both the global and d0track namespaces.
However, the diagnostic i actually get is:
$ ./cc1plus -quiet egcsbug9.cc
egcsbug9.cc: In function `void foo ()':
egcsbug9.cc:10: `CftCluster' undeclared (first use this function)
egcsbug9.cc:10: (Each undeclared identifier is reported only once
egcsbug9.cc:10: for each function it appears in.)
egcsbug9.cc:10: parse error before `;'
Since the problem is too many declarations rather than none,
this is rather confusing.
thanks,
sss