This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20547] undefined reference to "static const" fields of classes
- From: "Hu dot YuehWei at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Mar 2005 18:25:56 -0000
- Subject: [Bug c++/20547] undefined reference to "static const" fields of classes
- References: <20050319065920.20547.Hu.YuehWei@gmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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