public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/7498: copy constructor of ostream (and ios) is private and it should not be!
@ 2002-08-05  9:35 pme
  0 siblings, 0 replies; 4+ messages in thread
From: pme @ 2002-08-05  9:35 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, mdp, nobody

Synopsis: copy constructor of ostream (and ios) is private and it should not be!

State-Changed-From-To: open->closed
State-Changed-By: pme
State-Changed-When: Mon Aug  5 09:35:53 2002
State-Changed-Why:
    
    Not a compiler bug; see audit trail for explanation.

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


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

* Re: c++/7498: copy constructor of ostream (and ios) is private and it should not be!
@ 2002-08-05  9:46 Gabriel Dos Reis
  0 siblings, 0 replies; 4+ messages in thread
From: Gabriel Dos Reis @ 2002-08-05  9:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: mdp@fnal.gov
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/7498: copy constructor of ostream (and ios) is private and it should not be!
Date: 05 Aug 2002 18:34:23 +0200

 mdp@fnal.gov writes:
 
 | >Number:         7498
 | >Category:       c++
 | >Synopsis:       copy constructor of ostream (and ios) is private and it should not be!
 
 [...]
 
 | >Release:        gcc 2.96.3 20000503/Linux
                   
 There is no GCC release named 2.96.3, I guess you meant 2.95.3.
 That release is known to come with pre-standard library.
 The library that comes with GCC-3.x is much more compliant and meets
 the standard requirement in that area.
 
 [...]
 
 |   ostream a=file;
 
 This is ill-formed, you cannot copy a std::ostream.
 
 | works on Visual C++ but on g++
 
 If it worked with Visual C++, then it is a bug in that compiler.
 
 -- Gaby


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

* Re: c++/7498: copy constructor of ostream (and ios) is private and it should not be!
@ 2002-08-05  9:36 Phil Edwards
  0 siblings, 0 replies; 4+ messages in thread
From: Phil Edwards @ 2002-08-05  9:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Phil Edwards <phil@jaj.com>
To: mdp@fnal.gov
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/7498: copy constructor of ostream (and ios) is private and it should not be!
Date: Mon, 5 Aug 2002 12:35:08 -0400

 On Mon, Aug 05, 2002 at 04:22:39PM -0000, mdp@fnal.gov wrote:
 > The following program:
 > -----------------------------
 > #include "iostream"
 > #include "fstream"
 > void main() {
 >   ofstream file("test.dat");
 >   ostream a=file;
 >   a << "Hello\n";
 >   file.close();
 > }
 > -----------------------------
 > 
 > works on Visual C++
 
 Visual C++ is broken.
 
 > but on g++
 > gives the following error:
 
 Because the code is invalid.
 
 > Copy constructors of base_ios and derived classes should be public.
 
 No they shouldn't.  See section 27.4 of the C++ standard.
 
 -- 
 If ye love wealth greater than liberty, the tranquility of servitude greater
 than the animating contest for freedom, go home and leave us in peace.  We seek
 not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
 and may posterity forget that ye were our countrymen.            - Samuel Adams


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

* c++/7498: copy constructor of ostream (and ios) is private and it should not be!
@ 2002-08-05  9:26 mdp
  0 siblings, 0 replies; 4+ messages in thread
From: mdp @ 2002-08-05  9:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7498
>Category:       c++
>Synopsis:       copy constructor of ostream (and ios) is private and it should not be!
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 05 09:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Massimo Di Pierro
>Release:        gcc 2.96.3 20000503/Linux
>Organization:
>Environment:
Fermi Linux (www.fnal.gov) based on Red Hat 6.x.
>Description:
The following program:
-----------------------------
#include "iostream"
#include "fstream"
void main() {
  ofstream file("test.dat");
  ostream a=file;
  a << "Hello\n";
  file.close();
}
-----------------------------

works on Visual C++ but on g++
gives the following error:
-----------------------------
test.cpp: In method `ostream::ostream(int, int (***)(...), const ostream &)':
/usr/lib/gcc-lib/i386-redhat-linux/2.95.3/../../../../include/g++-3/streambuf.h:128: `ios::ios(const ios &)' is private
test.cpp:5: within this context
-----------------------------
>How-To-Repeat:

>Fix:
Copy constructors of base_ios and derived classes should be public.
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2002-08-05 16:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-05  9:35 c++/7498: copy constructor of ostream (and ios) is private and it should not be! pme
  -- strict thread matches above, loose matches on Subject: below --
2002-08-05  9:46 Gabriel Dos Reis
2002-08-05  9:36 Phil Edwards
2002-08-05  9:26 mdp

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