c++/7529: "using std::rel_ops::operator!=;" not accepted at function scope by GCC 3.1
lassi.tuura@cern.ch
lassi.tuura@cern.ch
Wed Aug 7 11:16:00 GMT 2002
>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 <utility>
struct I { bool operator== (const I &) const; };
void f () { using std::rel_ops::operator!=; I i; i != i; }
More information about the Gcc-bugs
mailing list