This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/3961: Parser bug



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]