From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13353 invoked by alias); 7 Feb 2003 02:26:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 13321 invoked by uid 71); 7 Feb 2003 02:26:01 -0000 Date: Fri, 07 Feb 2003 02:26:00 -0000 Message-ID: <20030207022601.13320.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Victor Isaac Lesk 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. Reply-To: Victor Isaac Lesk X-SW-Source: 2003-02/txt/msg00342.txt.bz2 List-Id: The following reply was made to PR c++/9602; it has been noted by GNATS. From: Victor Isaac Lesk To: , , , , , 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 #include using namespace std; template 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); templateoperator class Pair(void)const; friend ostream&operator<<(ostream&a,const class Pair&r) { return a<>(istream&a,class Pair&r) { return a>>r.first>>r.second; } }; template ostream& operator<<(ostream&,const Pair&); template istream& operator>>(istream&,Pair&); template Pair:: Pair(): last(second) { } template Pair:: Pair(const string s): last(second) { } template Pair:: Pair(t a,t b): last(second) { set_Pair(a,b); } template t Pair:: get_First(void)const { return first; } template t Pair:: get_Second(void)const { return second; } template t Pair:: get_Last(void)const { return last; } template void Pair:: set(t l,t h) { first=l;second=h; } template void Pair:: operator=(const Pair pair) { set_First(pair.first); set_Second(pair.second); } template void Pair:: set_Pair(t l,t h) { set(l,h); } template void Pair:: set_First(const t a) { first=a; } template void Pair:: set_Second(const t a) { second=a; } template bool Pair:: contains(const t a)const { return (a==first || a==second); } template bool Pair:: includes(const t a)const { return contains(a); } template void Pair:: display(void)const { cout<template Pair:: operator Pair(void)const { return Pair(l(first),l(second)); } int main(const int,const char*const*const) { Pair pair1; return 0; }