public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/7529: "using std::rel_ops::operator!=;" not accepted at function scope by GCC 3.1
@ 2002-08-07 11:16 lassi.tuura
  0 siblings, 0 replies; only message in thread
From: lassi.tuura @ 2002-08-07 11:16 UTC (permalink / raw)
  To: gcc-gnats


>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; }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-08-07 18:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-07 11:16 c++/7529: "using std::rel_ops::operator!=;" not accepted at function scope by GCC 3.1 lassi.tuura

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).