public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3961: Parser bug
@ 2001-08-12 12:35 rodrigc
  0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2001-08-12 12:35 UTC (permalink / raw)
  To: Sylvain.Pion, gcc-bugs, gcc-prs, nobody

Synopsis: Parser bug

State-Changed-From-To: open->feedback
State-Changed-By: rodrigc
State-Changed-When: Sun Aug 12 12:35:29 2001
State-Changed-Why:
    Your attachment contains only a single line.
    Is this correct?
    
    When I compiled it with: gcc version 3.0.1 20010811,
    it compiled for me without any warnings.
    
    Can you try a newer gcc snapshot?

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3961&database=gcc


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

* Re: c++/3961: Parser bug
@ 2001-08-13 12:36 Craig Rodrigues
  0 siblings, 0 replies; 3+ messages in thread
From: Craig Rodrigues @ 2001-08-13 12:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/3961; it has been noted by GNATS.

From: Craig Rodrigues <rodrigc@mediaone.net>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/3961: Parser bug
Date: Mon, 13 Aug 2001 15:26:39 -0400

 ----- Forwarded message from Sylvain Pion <Sylvain.Pion@sophia.inria.fr> -----
 
 Delivered-To: rodrigc@gcc.gnu.org
 Date: Mon, 13 Aug 2001 11:06:33 +0200
 From: Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
 To: rodrigc@gcc.gnu.org
 Cc: Sylvain.Pion@sophia.inria.fr, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
    nobody@gcc.gnu.org
 Subject: Re: c++/3961: Parser bug
 User-Agent: Mutt/1.2.5i
 In-Reply-To: < 20010812193529.26727.qmail@sourceware.cygnus.com >; from rodrigc@gcc.gnu.org on Sun, Aug 12, 2001 at 07:35:29PM -0000
 
 On Sun, Aug 12, 2001 at 07:35:29PM -0000, rodrigc@gcc.gnu.org wrote:
 >     Your attachment contains only a single line.
 >     Is this correct?
 
 No, it's not what I wanted to show, I don't know what happened to the
 attachment.  Here's the complete code :
 
 template <class i> struct FT {};
 
 double to_dbl(FT<int>) { return 0.0; }
 
 struct bb { bb(double) {} };
 
 struct GV { GV(bb) {} };
 
 int main()
 {
   FT<int> m;
   GV gv(bb(to_dbl(m)));
 //GV gv(bb((double)to_dbl(m)));
 }
 
 >     When I compiled it with: gcc version 3.0.1 20010811,
 >     it compiled for me without any warnings.
 >     
 >     Can you try a newer gcc snapshot?
 
 The bug is still there.
 
 After sending this bug-report, I noticed that it's quite similar to what is
 mentionned in http://gcc.gnu.org/bugs.html#parsing , so it's probably
 nothing new.
 
 -- 
 Sylvain
 
 ----- End forwarded message -----


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

* c++/3961: Parser bug
@ 2001-08-08  7:26 Sylvain.Pion
  0 siblings, 0 replies; 3+ messages in thread
From: Sylvain.Pion @ 2001-08-08  7:26 UTC (permalink / raw)
  To: gcc-gnats; +Cc: Sylvain.Pion

>Number:         3961
>Category:       c++
>Synopsis:       Parser bug
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 08 07:26:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Sylvain.Pion@sophia.inria.fr
>Release:        3.0
>Organization:
>Environment:
Reading specs from ./gcc/Linux_3.0/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Configured with: /u/zosma/0/prisme/spion/gcc/gcc/configure --enable-languages=c++ --prefix=/u/zosma/0/prisme/spion/gcc/Linux_CVS
Thread model: single
gcc version 3.0
>Description:
The attached C++ program produces the error :
bbox.C: In function `int main()':
bbox.C:12: no matching function for call to `bb::bb (FT<int> &)'
bbox.C:5: candidates are: bb::bb(double)
bbox.C:5:                 bb::bb(const bb &) 

The bug is present with GCC 2.95.3, 3.0,
3.0.1 (current) and 3.1 (current).  It seems it works on
the cp-parser-branch, although I was only able to test with
cc1plus there.
>How-To-Repeat:
Just type "g++ bbox.C"
>Fix:
Workarounds : either add an explicit cast to double
(see the comment), or create a "bb" object separately.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="bbox.C"
Content-Disposition: inline; filename="bbox.C"

template <class i> struct FT {};

double to_dbl(FT<int>) { return 0.0; }

struct bb { bb(double) {} };

struct GV { GV(bb) {} };

int main()
{
  FT<int> m;
  GV gv(bb(to_dbl(m)));
//GV gv(bb((double)to_dbl(m)));
}


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

end of thread, other threads:[~2001-08-13 12:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-12 12:35 c++/3961: Parser bug rodrigc
  -- strict thread matches above, loose matches on Subject: below --
2001-08-13 12:36 Craig Rodrigues
2001-08-08  7:26 Sylvain.Pion

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