public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: "using" directive bug
@ 2003-01-29 17:10 Hans Utz
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Utz @ 2003-01-29 17:10 UTC (permalink / raw)
  To: gcc, LAssinovsky

>        using N1::operator ==; //Have an error here

Killing the space between operator and == should do the trick.

using N1::operator==;

I was cought by that a week ago, too.
But I don't know, who's fault it is.
I'd guess it is ours.

HTH,
Hans

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "using" directive bug
  2003-01-29 18:53 ` Hans Utz
  2003-01-29 22:21   ` Neil Booth
@ 2003-01-29 23:07   ` Mark Mitchell
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Mitchell @ 2003-01-29 23:07 UTC (permalink / raw)
  To: Hans Utz, Lev Assinovsky; +Cc: gcc



--On Wednesday, January 29, 2003 06:47:01 PM +0100 Hans Utz 
<hans.utz@informatik.uni-ulm.de> wrote:

> Is there a language lawyer to confirm that it's a bug?

Yes; that's a bug.

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "using" directive bug
  2003-01-29 18:53 ` Hans Utz
@ 2003-01-29 22:21   ` Neil Booth
  2003-01-29 23:07   ` Mark Mitchell
  1 sibling, 0 replies; 6+ messages in thread
From: Neil Booth @ 2003-01-29 22:21 UTC (permalink / raw)
  To: Hans Utz; +Cc: Lev Assinovsky, gcc

Hans Utz wrote:-

> Sorry, I was totally wrong.
> I did some testing with your code and mine.
> I can't even reproduce my test case where space killing seemed to help :-(

Killing space can never help (unless the preprocessor is seriously
screwed) since the compiler only sees a token stream.  It doesn't care
about whitespace.

Neil.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: "using" directive bug
  2003-01-29 17:23 Lev Assinovsky
@ 2003-01-29 18:53 ` Hans Utz
  2003-01-29 22:21   ` Neil Booth
  2003-01-29 23:07   ` Mark Mitchell
  0 siblings, 2 replies; 6+ messages in thread
From: Hans Utz @ 2003-01-29 18:53 UTC (permalink / raw)
  To: Lev Assinovsky; +Cc: gcc

Sorry, I was totally wrong.
I did some testing with your code and mine.
I can't even reproduce my test case where space killing seemed to help :-(

The using directives of your code work in any namespace. g++ 2.95.3 and 3.2.1
just rejects them within the method.

The new parser in GCC 3.4 accepts it.

Is there a language lawyer to confirm that it's a bug?

Lev Assinovsky wrote:
> 
> No, space killing doesn't help :(
> 
> ----
> Lev Assinovsky
> Aelita Software Corporation
> O&S Core Division, Programmer
> ICQ# 165072909
> 
> > -----Original Message-----
> > From: Hans Utz [mailto:hans.utz@informatik.uni-ulm.de]
> > Sent: Wednesday, January 29, 2003 6:29 PM
> > To: gcc@gcc.gnu.org; Lev Assinovsky
> > Subject: Re: "using" directive bug
> >
> >
> > >        using N1::operator ==; //Have an error here
> >
> > Killing the space between operator and == should do the trick.
> >
> > using N1::operator==;
> >
> > I was cought by that a week ago, too.
> > But I don't know, who's fault it is.
> > I'd guess it is ours.
> >
> > HTH,
> > Hans
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: "using" directive bug
@ 2003-01-29 17:23 Lev Assinovsky
  2003-01-29 18:53 ` Hans Utz
  0 siblings, 1 reply; 6+ messages in thread
From: Lev Assinovsky @ 2003-01-29 17:23 UTC (permalink / raw)
  To: Hans Utz, gcc

No, space killing doesn't help :(

----
Lev Assinovsky
Aelita Software Corporation
O&S Core Division, Programmer
ICQ# 165072909


> -----Original Message-----
> From: Hans Utz [mailto:hans.utz@informatik.uni-ulm.de]
> Sent: Wednesday, January 29, 2003 6:29 PM
> To: gcc@gcc.gnu.org; Lev Assinovsky
> Subject: Re: "using" directive bug
> 
> 
> >        using N1::operator ==; //Have an error here
> 
> Killing the space between operator and == should do the trick.
> 
> using N1::operator==;
> 
> I was cought by that a week ago, too.
> But I don't know, who's fault it is.
> I'd guess it is ours.
> 
> HTH,
> Hans
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* "using" directive bug
@ 2003-01-29 16:15 Lev Assinovsky
  0 siblings, 0 replies; 6+ messages in thread
From: Lev Assinovsky @ 2003-01-29 16:15 UTC (permalink / raw)
  To: gcc

Hi all!
I got a compiler error "parse error before `operator' " for the following
program:

namespace N1
{
    struct A
    {
        int a;
    };

    int f() {}
    bool operator == (const A& a, const A& b) { return true; }
}


int main()
{
    if (1)
    {
        using N1::A;
        using N1::f;
        using N1::operator ==; //Have an error here

    }
}

The error occurs on both gcc 3.2 solaris-intel and gcc 3.2.1 solaris-sparc
compilers.
Is that a bug?


----
Lev Assinovsky
Aelita Software Corporation
O&S Core Division, Programmer
ICQ# 165072909

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-01-29 22:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-29 17:10 "using" directive bug Hans Utz
  -- strict thread matches above, loose matches on Subject: below --
2003-01-29 17:23 Lev Assinovsky
2003-01-29 18:53 ` Hans Utz
2003-01-29 22:21   ` Neil Booth
2003-01-29 23:07   ` Mark Mitchell
2003-01-29 16:15 Lev Assinovsky

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).