From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15842 invoked by alias); 26 Mar 2002 11:16:07 -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 15798 invoked by uid 71); 26 Mar 2002 11:16:02 -0000 Resent-Date: 26 Mar 2002 11:16:02 -0000 Resent-Message-ID: <20020326111602.15797.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, Alexander Zvyagin Received:(qmail 14348 invoked from network); 26 Mar 2002 11:10:41 -0000 Received: from unknown (HELO smtp3.cern.ch) (137.138.131.164) by sources.redhat.com with SMTP; 26 Mar 2002 11:10:41 -0000 Received: from lxplus015.cern.ch (IDENT:root@lxplus015.cern.ch [137.138.161.112]) by smtp3.cern.ch (8.12.1/8.12.1) with ESMTP id g2QBAeSE003940 for ; Tue, 26 Mar 2002 12:10:41 +0100 (MET) Received: (from zvyagin@localhost) by lxplus015.cern.ch (8.9.3/8.9.3) id MAA10926; Tue, 26 Mar 2002 12:10:54 +0100 Message-Id:<200203261110.MAA10926@lxplus015.cern.ch> Date: Tue, 26 Mar 2002 03:16:00 -0000 From: Alexander Zvyagin To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:3.113 Subject: c++/6060: c++: object is not created X-SW-Source: 2002-03/txt/msg00970.txt.bz2 List-Id: >Number: 6060 >Category: c++ >Synopsis: c++: object is not created >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Mar 26 03:16:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: >Release: >Organization: >Environment: System: Linux lxplus015 2.2.19-6.2.1.1smp #1 SMP Tue Apr 17 20:00:04 CEST 2001 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../configure --prefix=/afs/cern.ch/compass/delivery/tools/gcc-3.0.4 Description: The code shown below should create four objects of the class TT. But only three objects are created (there are only three calls for the constructors/destructor). // File constructors.cc #include using std::cout; class TT { public: ~TT (void ) {cout << "D\n";} TT (void ) : c(' ') {cout << "C\n";} TT (char cc) : c(cc ) {cout << "C " << c << "\n";} char c; }; int main() { cout << "1\n"; TT(); cout << "2\n"; TT t2('a'); cout << "3\n"; TT t3(); // The object is not created!!! cout << "4\n"; TT t4; // OK! cout << "5\n"; } // EOF Output: $ ./a.out 1 C D 2 C a 3 4 C 5 D D So the object 't3' was not created. >Description: Originator: Alexander Zvyagin Organization: LMU,CERN Synopsis: T t(); object creation does not work Severity: serious Priority: medium Class: wrong-code Release: 3.0.4 >How-To-Repeat: $ g++ constructors.cc $ ./a.out >Fix: >Release-Note: >Audit-Trail: >Unformatted: