From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28109 invoked by alias); 16 May 2009 17:30:38 -0000 Received: (qmail 27980 invoked by uid 48); 16 May 2009 17:30:22 -0000 Date: Sat, 16 May 2009 17:30:00 -0000 Subject: [Bug c++/40173] New: Calling a constructor from another constructor of the same class X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "raven at student dot pwr dot wroc dot pl" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-05/txt/msg01426.txt.bz2 Command line: g++ -pedantic -Wall -o test test.cpp Compiler output: none Basically, I created a class with two constructors. One of those is trying to call the other one. The call doesn't seem to have any effect at all. The problem is: g++ allows such a thing with no warnings at all. Apart from that, I believe such functionality might be useful. For example, if we've got a constructor with one parameter and quite a heavy block of code, along with another constructor that takes no arguments - which we'd like to be a wrapper for the first one, passing some kind of default value to it. Thanks for your time ;) -- Summary: Calling a constructor from another constructor of the same class Product: gcc Version: 4.3.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: raven at student dot pwr dot wroc dot pl GCC build triplet: i486-linux-gnu GCC host triplet: i486-linux-gnu GCC target triplet: i486-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40173