From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19956 invoked by alias); 5 Aug 2002 16:26:01 -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 19933 invoked by uid 71); 5 Aug 2002 16:26:01 -0000 Resent-Date: 5 Aug 2002 16:26:01 -0000 Resent-Message-ID: <20020805162601.19932.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, mdp@fnal.gov Received: (qmail 19490 invoked by uid 61); 5 Aug 2002 16:22:39 -0000 Message-Id: <20020805162239.19489.qmail@sources.redhat.com> Date: Mon, 05 Aug 2002 09:26:00 -0000 From: mdp@fnal.gov Reply-To: mdp@fnal.gov To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/7498: copy constructor of ostream (and ios) is private and it should not be! X-SW-Source: 2002-08/txt/msg00090.txt.bz2 List-Id: >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: