Debian Bug report logs - #195468
g++ fails to recognize illformedness of certain initializers

Package: g++; Maintainer for g++ is Debian GCC Maintainers <[email protected]>; Source for g++ is src:gcc-defaults (PTS, buildd, popcon).

Reported by: Herbert Valerio Riedel <[email protected]>

Date: Fri, 30 May 2003 19:33:11 UTC

Severity: normal

Tags: upstream

Forwarded to http://gcc.gnu.org/PR12567

Full log


Message #10 received at [email protected] (full text, mbox, reply):

Received: (at 195468) by bugs.debian.org; 30 May 2003 20:08:33 +0000
From [email protected] Fri May 30 15:08:32 2003
Return-path: <[email protected]>
Received: from ns2.jaj.com [66.93.21.106] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 19LqAy-0000rL-00; Fri, 30 May 2003 15:08:32 -0500
Received: by ns2.jaj.com (Postfix, from userid 1002)
	id B9D702D516; Fri, 30 May 2003 16:08:29 -0400 (EDT)
Date: Fri, 30 May 2003 16:08:29 -0400
From: Phil Edwards <[email protected]>
To: Herbert Valerio Riedel <[email protected]>,
	[email protected]
Subject: Re: Bug#195468: g++-3.3: default construction fails when no explicit default constructor defined
Message-ID: <[email protected]>
References: <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[email protected]>
User-Agent: Mutt/1.5.3i
Delivered-To: [email protected]
X-Spam-Status: No, hits=-21.8 required=4.0
	tests=BAYES_20,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,
	      REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_MUTT
	autolearn=ham version=2.53-bugs.debian.org_2003_05_24
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_05_24 (1.174.2.15-2003-03-30-exp)
On Fri, May 30, 2003 at 09:26:32PM +0200, Herbert Valerio Riedel wrote:
> $ cat static_var.cc
> 
> class bar {
> public:
>   int operator()(int i) { return i; }
>   //bar (void) {} // default constructor
> };
> 
> const bar b = bar (); // works always...
> const bar b2; // fails if there is no explicit default constructor
> $ g++ -c -O0 -Wall static_var.cc
> static_var.cc:9: uninitialized const `b2'
> $
> 
> if the commented out default constructor is enabled, compilation
> succeeds...

Or if you declare b2 as non-const.  This is not a bug.

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 14:23:36 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.