This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47396] Link error when declare a constant reference to a class or struct static const member!
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 21 Jan 2011 13:38:34 +0000
- Subject: [Bug c++/47396] Link error when declare a constant reference to a class or struct static const member!
- Auto-submitted: auto-generated
- References: <bug-47396-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47396
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |jakub at gcc dot gnu.org
Resolution| |INVALID
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-21 13:38:28 UTC ---
That's a user error. In C++ you need to provide a definition for static const
data members, even when it is initialized in its declaration.
Just add:
const int test::uri;
somewhere.