From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24704 invoked by alias); 7 Aug 2002 18:16:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 24678 invoked by uid 71); 7 Aug 2002 18:16:01 -0000 Resent-Date: 7 Aug 2002 18:16:01 -0000 Resent-Message-ID: <20020807181601.24677.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, lassi.tuura@cern.ch Received: (qmail 24499 invoked by uid 61); 7 Aug 2002 18:15:04 -0000 Message-Id: <20020807181504.24497.qmail@sources.redhat.com> Date: Wed, 07 Aug 2002 11:16:00 -0000 From: lassi.tuura@cern.ch Reply-To: lassi.tuura@cern.ch To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/7529: "using std::rel_ops::operator!=;" not accepted at function scope by GCC 3.1 X-SW-Source: 2002-08/txt/msg00140.txt.bz2 List-Id: >Number: 7529 >Category: c++ >Synopsis: "using std::rel_ops::operator!=;" not accepted at function scope by GCC 3.1 >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Wed Aug 07 11:16:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Lassi A. Tuura >Release: 3.1 >Organization: >Environment: Reading specs from /usr/local/cluster/gcc-3.1/objdir/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.1/specs Configured with: ../configure --prefix=/usr/local/cluster/gcc-3.1/objdir/ Thread model: single gcc version 3.1 >Description: G++ rejects what by my reading seems like a valid using-declaration. $ /usr/local/cluster/gcc-3.1/objdir/bin/c++ -c foo.cc foo.cc: In function `void f()': foo.cc:3: parse error before `operator' foo.cc:3: `I' undeclared (first use this function) foo.cc:3: (Each undeclared identifier is reported only once for each function it appears in.) foo.cc:3: `i' undeclared (first use this function) >How-To-Repeat: >Fix: Workaround is to either move the using-declaration out of the function to the file scope, or turn it in the function scope to: using namespace std::rel_ops; >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="foo.cc" Content-Disposition: inline; filename="foo.cc" #include struct I { bool operator== (const I &) const; }; void f () { using std::rel_ops::operator!=; I i; i != i; }