From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29122 invoked by alias); 16 Jul 2002 00:27:22 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 29103 invoked from network); 16 Jul 2002 00:27:17 -0000 Received: from unknown (HELO srv01.cas.org) (134.243.50.9) by sources.redhat.com with SMTP; 16 Jul 2002 00:27:17 -0000 Received: from mah21awu.cas.org (mah21awu [134.243.40.124]) by srv01.cas.org (8.11.6+Sun/m4_8.11.6/CAS_MAIL_HUB-1.15) with ESMTP id g6G0RGO14402 for ; Mon, 15 Jul 2002 20:27:16 -0400 (EDT) Received: (from mah21@localhost) by mah21awu.cas.org (8.10.2+Sun/m4_8.10.2/CAS_CLIENT-1.18) id g6G0REl15177 for gcc-help@gcc.gnu.org; Mon, 15 Jul 2002 20:27:14 -0400 (EDT) From: Mike Harrold Message-Id: <200207160027.g6G0REl15177@mah21awu.cas.org> Subject: Missing constructor call... To: gcc-help@gcc.gnu.org Date: Mon, 15 Jul 2002 17:27:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-07/txt/msg00140.txt.bz2 Hi, I'm wondering if anyone knows of an existing bug report for something I have run into. If I have a class representing iterators, then under certain circumstances: const C::const_iterator start = my_list.begin(); C::const_iterator iter = start; will result in no constructor being called for iter, Whereas: const C::const_iterator start = my_list.begin(); C::const_iterator iter; iter = start; results in the correct code. Also: const C::const_iterator start = my_list.begin(); C::const_iterator iter(start); results in no copy constructor being called either. In all cases compiling without optimisation, or with -O2 results in the same behaviour. My gcc version is: Reading specs from /usr/local/gcc-3.0.2/lib/gcc-lib/i686-pc-linux-gnu/3.0.2/specs Configured with: ../configure --prefix=/usr/local/gcc-3.0.2 --enable-shared --enable-threads --enable-languages=c,c++,java Thread model: posix gcc version 3.0.2 If this (or something similar) is known, I wont file a bug report. If it isn't (and it still occurs in 3.0.4, which I am downloading right now), I will go ahead. I can't use 3.1 for now as it will require some work to fix my code, but if this is a known problem that is fixed in 3.1 let me know and I'll put aside some time for a code conversion. Thanks for your time, /Mike