From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5286 invoked by alias); 26 Jul 2010 15:32:42 -0000 Received: (qmail 5233 invoked by uid 48); 26 Jul 2010 15:32:22 -0000 Date: Mon, 26 Jul 2010 15:32:00 -0000 Message-ID: <20100726153222.5232.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/45082] Static const signed int class member causes undefined symbol. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub 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: 2010-07/txt/msg02876.txt.bz2 ------- Comment #1 from jakub at gcc dot gnu dot org 2010-07-26 15:32 ------- This is not valid C++. See [class.static.data]/4: If a static data member is of const integral or const enumeration type, its declaration in the class definition can specify a constant-initializer which shall be an integral constant expression (5.19). In that case, the member can appear in integral constant expressions within its scope. The member shall still be defined in a namespace scope if it is used in the program and the namespace scope definition shall not contain an initializer. Your testcase doesn't have the needed const int myclass::BUFF_SIZE; anywhere. -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45082