public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/9602: falsely concludes that function defined within class body is virtual and abstract, therefore compiler fails to allow class instantiation with pure virtual function error.
@ 2003-02-07  2:26 Victor Isaac Lesk
  0 siblings, 0 replies; 3+ messages in thread
From: Victor Isaac Lesk @ 2003-02-07  2:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Victor Isaac Lesk <vil@rccp.tsukuba.ac.jp>
To: <bangerth@dealii.org>, <gcc-bugs@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>,
   <nobody@gcc.gnu.org>, <vil@rccp.tsukuba.ac.jp>, <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: c++/9602: falsely concludes that function defined within class
 body is virtual and abstract, therefore compiler fails to allow class
 instantiation with pure virtual function error.
Date: Fri, 7 Feb 2003 11:22:12 +0900 (JST)

 On 6 Feb 2003 bangerth@dealii.org wrote:
 
 > Synopsis: falsely concludes that function defined within class body is virtual and abstract, therefore compiler fails to allow class instantiation with pure virtual function error.
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: bangerth
 > State-Changed-When: Thu Feb  6 23:23:46 2003
 > State-Changed-Why:
 >     For some reason, the testcase didn't make it into the
 >     report. Can you try to send it to me so that I can attach
 >     it to the report?
 >     
 >     Thanks
 >       Wolfgang
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9602
 > 
 
 Here it is:
 //////////////
 #include<iostream>
 #include<stdio.h>
 
 using namespace std;
 
 template<typename t>
 class Pair
 {
 private:
 protected:
 public:
   t first;
   t second;
   t&last;
 
   Pair();
   Pair(t,t);
   Pair(const string);
 
   void set_Pair(const t,const t);
   void set(const t,const t);
   void set_First(const t);
   void set_Second(const t);
   void set_Last(const t);
   t get_First(void)const;
   t get_Second(void)const;
   t get_Last(void)const;
   bool contains(const t)const;
   bool includes(const t)const;
 
   void display(void)const;
 
   void operator=(const Pair<t>);
 
   template<typename l>operator class Pair<l>(void)const;
 
   friend ostream&operator<<(ostream&a,const class Pair<t>&r)
     {
       return a<<r.first<<SPC<<r.second;
     }
   friend istream&operator>>(istream&a,class Pair<t>&r)
     {
       return a>>r.first>>r.second;
     }
 };
 
 template<typename t>
 ostream&
 operator<<(ostream&,const Pair<t>&);
 
 template<typename t>
 istream&
 operator>>(istream&,Pair<t>&);
 
 
 template<typename t>
 Pair<t>::
 Pair():
   last(second)
 {
 }
 
 template<typename t>
 Pair<t>::
 Pair(const string s):
   last(second)
 {
 }
 
 template<typename t>
 Pair<t>::
 Pair(t a,t b):
   last(second)
 {
   set_Pair(a,b);
 }
 
 template<typename t>
 t
 Pair<t>::
 get_First(void)const
 {
   return first;
 }
 
 template<typename t>
 t
 Pair<t>::
 get_Second(void)const
 {
   return second;
 }
 
 template<typename t>
 t
 Pair<t>::
 get_Last(void)const
 {
   return last;
 }
 
 template<typename t>
 void
 Pair<t>::
 set(t l,t h)
 {
   first=l;second=h;
 }
 
 template<typename t>
 void
 Pair<t>::
 operator=(const Pair<t> pair)
 {
   set_First(pair.first);
   set_Second(pair.second);
 }
 
 template<typename t>
 void
 Pair<t>::
 set_Pair(t l,t h)
 {
   set(l,h);
 }
 
 template<typename t>
 void
 Pair<t>::
 set_First(const t a)
 {
   first=a;
 }
 
 template<typename t>
 void
 Pair<t>::
 set_Second(const t a)
 {
   second=a;
 }
 
 template<typename t>
 bool
 Pair<t>::
 contains(const t a)const
 {
   return (a==first || a==second);
 }
 
 template<typename t>
 bool
 Pair<t>::
 includes(const t a)const
 {
   return contains(a);
 }
 
 template<typename t>
 void
 Pair<t>::
 display(void)const
 {
   cout<<LPR<<first<<COM<<second<<RPR;
 }
 
 template<typename t>template<typename l>
 Pair<t>::
 operator Pair<l>(void)const
 {
   return Pair<l>(l(first),l(second));
 }
 
 int main(const int,const char*const*const)
 {
   Pair<int> pair1;
 
 
 
   return 0;
 }
 
 
 
 


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

* Re: c++/9602: falsely concludes that function defined within class body is virtual and abstract, therefore compiler fails to allow class instantiation with pure virtual function error.
@ 2003-02-06 23:23 bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2003-02-06 23:23 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, vil

Synopsis: falsely concludes that function defined within class body is virtual and abstract, therefore compiler fails to allow class instantiation with pure virtual function error.

State-Changed-From-To: open->feedback
State-Changed-By: bangerth
State-Changed-When: Thu Feb  6 23:23:46 2003
State-Changed-Why:
    For some reason, the testcase didn't make it into the
    report. Can you try to send it to me so that I can attach
    it to the report?
    
    Thanks
      Wolfgang

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9602


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

* c++/9602: falsely concludes that function defined within class body is virtual and abstract, therefore compiler fails to allow class instantiation with pure virtual function error.
@ 2003-02-06 21:26 vil
  0 siblings, 0 replies; 3+ messages in thread
From: vil @ 2003-02-06 21:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9602
>Category:       c++
>Synopsis:       falsely concludes that function defined within class body is virtual and abstract, therefore compiler fails to allow class instantiation with pure virtual function error.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 06 21:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Victor Lesk
>Release:        g++ -v Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2/specs Configured with: ../configure --prefix=/usr --libdir=/usr/lib --with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-thr
>Organization:
>Environment:
uname -a
Linux localhost.localdomain 2.4.19-16mdk #1 Fri Sep 20 18:15:05 CEST 2002 i686 unknown unknown GNU/Linux
>Description:
Fails to compile code which was legal under 2.96, does not include any of the patterns in the known-bugs list.

Refuses to instantiate a template class on the grounds that it has abstract functions, when in fact the functions concerned are not even virtual
>How-To-Repeat:
g++ yum.C
>Fix:
please
>Release-Note:
>Audit-Trail:
>Unformatted:
 eads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-languages=c,c++,ada,f77,objc,java --host=i586-mandrake-linux-gnu --with-system-zlib Thread model: posix gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)


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

end of thread, other threads:[~2003-02-07  2:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-07  2:26 c++/9602: falsely concludes that function defined within class body is virtual and abstract, therefore compiler fails to allow class instantiation with pure virtual function error Victor Isaac Lesk
  -- strict thread matches above, loose matches on Subject: below --
2003-02-06 23:23 bangerth
2003-02-06 21:26 vil

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