This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/100: Re: confusing name lookup diagnostic (cvs g++ 20000306)
- To: gcc-gnats at sourceware dot cygnus dot com
- Subject: c++/100: Re: confusing name lookup diagnostic (cvs g++ 20000306)
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sun, 12 Mar 2000 09:47:32 +0100
- References: <200003090254.UAA61362@d0sgibnl1.fnal.gov>
- Resent-Cc: gcc-prs at gcc dot gnu dot org, snyder at fnal dot gov
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de>
Note: There was a bad value `rejects-legal-code' for the field `>Class:'.
It was set to the default value of `sw-bug'.
>Number: 100
>Category: c++
>Synopsis: confusing name lookup diagnostic
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: analyzed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Mar 12 00:56:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: scott snyder <snyder@fnal.gov>
>Release: (cvs g++ 20000306)
>Organization:
>Environment:
>Description:
Original-Message-Id: <200003090254.UAA61362@d0sgibnl1.fnal.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
[MvL - I think the code is well-formed, both definitions refer to the
same entity]
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: