From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18271 invoked by alias); 19 Mar 2005 18:26:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 18108 invoked by uid 48); 19 Mar 2005 18:25:56 -0000 Date: Sat, 19 Mar 2005 18:26:00 -0000 Message-ID: <20050319182556.18107.qmail@sourceware.org> From: "Hu dot YuehWei at gmail dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050319065920.20547.Hu.YuehWei@gmail.com> References: <20050319065920.20547.Hu.YuehWei@gmail.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/20547] undefined reference to "static const" fields of classes X-Bugzilla-Reason: CC X-SW-Source: 2005-03/txt/msg02365.txt.bz2 List-Id: ------- Additional Comments From Hu dot YuehWei at gmail dot com 2005-03-19 18:25 ------- I see. But why compiler doesn't also make a temporary variable for the constant defined in a class scope? Such as following codes: struct T { static int const a = 3; }; void fff(int const &a) { } int main() { fff(T::a); /* compiler will not make a temporary variable for it. */ fff(4); /* compiler will make a temporary variable for it. */ return 0; } -- What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20547