This is the mail archive of the gcc-bugs@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]

confusing name lookup diagnostic (cvs g++ 20000306)



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

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