From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6891 invoked by alias); 25 Feb 2010 07:06:02 -0000 Received: (qmail 5519 invoked by uid 48); 25 Feb 2010 07:05:48 -0000 Date: Thu, 25 Feb 2010 07:06:00 -0000 Message-ID: <20100225070548.5516.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/19808] miss a warning about uninitialized members in constructor In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "bart dot vanassche at gmail dot com" 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: 2010-02/txt/msg02546.txt.bz2 ------- Comment #19 from bart dot vanassche at gmail dot com 2010-02-25 07:05 ------- (In reply to comment #17) > (In reply to comment #15) > > Alternatively, the C++ front-end could create an uninitialized variable for > > each member variable. Initialize those, then, at the very end of the > > constructor, assigned each clone variable to the appropriate member. > > That would break if the constructor calls any other member functions. It is even possible to trigger member function calls from inside the initializer list. This will result in member functions being invoked for a partially initialized object. Some compilers emit a warning when the 'this' pointer is passed as a function argument from inside the initializer list. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19808