From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22106 invoked by alias); 26 Feb 2007 23:00:33 -0000 Received: (qmail 22036 invoked by uid 48); 26 Feb 2007 23:00:22 -0000 Date: Mon, 26 Feb 2007 23:00:00 -0000 Message-ID: <20070226230022.22035.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/30962] cause compile error for "const anonymous class object" In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" 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: 2007-02/txt/msg02923.txt.bz2 ------- Comment #3 from pinskia at gcc dot gnu dot org 2007-02-26 23:00 ------- (In reply to comment #2) > Not sure what you mean by "MyAnonymous = {};" to initialize it... if change to: You example which you gave works for me with that: const class { public: int foo() const { return 1; } } MyAnonymous = {}; int main() { return MyAnonymous.foo(); } apinski@debian:~$ ~/x86-linux-4.0.2/bin/gcc t.cc apinski@debian:~$ gcc t.cc Anyways this is not a GCC bug but rather you not knowing C++. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30962